Decouple galleries from scenes (#1057)

This commit is contained in:
InfiniteTF
2021-02-01 21:56:54 +01:00
committed by GitHub
parent 86bfb64a0d
commit 4fd022a93b
54 changed files with 952 additions and 755 deletions

View File

@@ -1,16 +1,20 @@
import React from "react";
import * as GQL from "src/core/generated-graphql";
import { useFindGallery } from "src/core/StashService";
import { useLightbox } from "src/hooks";
import { LoadingIndicator } from "src/components/Shared";
import "flexbin/flexbin.css";
interface IProps {
gallery: GQL.GalleryDataFragment;
galleryId: string;
}
export const GalleryViewer: React.FC<IProps> = ({ gallery }) => {
const images = gallery?.images ?? [];
export const GalleryViewer: React.FC<IProps> = ({ galleryId }) => {
const { data, loading } = useFindGallery(galleryId);
const images = data?.findGallery?.images ?? [];
const showLightbox = useLightbox({ images, showNavigation: false });
if (loading) return <LoadingIndicator />;
const thumbs = images.map((file, index) => (
<div
role="link"