mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Prettier
This commit is contained in:
@@ -11,7 +11,10 @@ export const GalleryViewer: FunctionComponent<IProps> = ({ gallery }) => {
|
||||
const [currentImage, setCurrentImage] = useState<number>(0);
|
||||
const [lightboxIsOpen, setLightboxIsOpen] = useState<boolean>(false);
|
||||
|
||||
function openLightbox(_event: React.MouseEvent<Element>, obj: {index: number}) {
|
||||
function openLightbox(
|
||||
_event: React.MouseEvent<Element>,
|
||||
obj: { index: number }
|
||||
) {
|
||||
setCurrentImage(obj.index);
|
||||
setLightboxIsOpen(true);
|
||||
}
|
||||
@@ -26,8 +29,15 @@ export const GalleryViewer: FunctionComponent<IProps> = ({ gallery }) => {
|
||||
setCurrentImage(currentImage + 1);
|
||||
}
|
||||
|
||||
const photos = gallery.files.map((file) => ({src: file.path || "", caption: file.name}));
|
||||
const thumbs = gallery.files.map((file) => ({src: `${file.path}?thumb=true` || "", width: 1, height: 1}));
|
||||
const photos = gallery.files.map(file => ({
|
||||
src: file.path || "",
|
||||
caption: file.name
|
||||
}));
|
||||
const thumbs = gallery.files.map(file => ({
|
||||
src: `${file.path}?thumb=true` || "",
|
||||
width: 1,
|
||||
height: 1
|
||||
}));
|
||||
return (
|
||||
<div>
|
||||
<Gallery photos={thumbs} columns={15} onClick={openLightbox} />
|
||||
|
||||
Reference in New Issue
Block a user