mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Blueprint removed
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import React, { FunctionComponent, useState } from "react";
|
||||
import Lightbox from "react-images";
|
||||
import Gallery from "react-photo-gallery";
|
||||
import * as GQL from "../../core/generated-graphql";
|
||||
import * as GQL from "src/core/generated-graphql";
|
||||
|
||||
interface IProps {
|
||||
gallery: GQL.GalleryDataFragment;
|
||||
}
|
||||
|
||||
export const GalleryViewer: FunctionComponent<IProps> = (props: IProps) => {
|
||||
export const GalleryViewer: FunctionComponent<IProps> = ({ gallery }) => {
|
||||
const [currentImage, setCurrentImage] = useState<number>(0);
|
||||
const [lightboxIsOpen, setLightboxIsOpen] = useState<boolean>(false);
|
||||
|
||||
function openLightbox(event: any, obj: any) {
|
||||
function openLightbox(_event: React.MouseEvent<Element>, obj: {index: number}) {
|
||||
setCurrentImage(obj.index);
|
||||
setLightboxIsOpen(true);
|
||||
}
|
||||
@@ -26,8 +26,8 @@ export const GalleryViewer: FunctionComponent<IProps> = (props: IProps) => {
|
||||
setCurrentImage(currentImage + 1);
|
||||
}
|
||||
|
||||
const photos = props.gallery.files.map((file) => ({src: file.path || "", caption: file.name}));
|
||||
const thumbs = props.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