mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Add gallery link to image lightbox (#6012)
This commit is contained in:
parent
fd36c0fac7
commit
b1883f3df5
5 changed files with 55 additions and 8 deletions
|
|
@ -6,7 +6,7 @@ export interface IFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IObjectWithFiles {
|
interface IObjectWithFiles {
|
||||||
files?: IFile[];
|
files?: GQL.Maybe<IFile[]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IObjectWithTitleFiles extends IObjectWithFiles {
|
export interface IObjectWithTitleFiles extends IObjectWithFiles {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ interface IFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IGallery {
|
interface IGallery {
|
||||||
files: IFile[];
|
files: GQL.Maybe<IFile[]>;
|
||||||
folder?: GQL.Maybe<IFile>;
|
folder?: GQL.Maybe<IFile>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,13 @@ import {
|
||||||
faSearchMinus,
|
faSearchMinus,
|
||||||
faTimes,
|
faTimes,
|
||||||
faBars,
|
faBars,
|
||||||
|
faImages,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
|
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
|
||||||
import { useDebounce } from "../debounce";
|
import { useDebounce } from "../debounce";
|
||||||
import { isVideo } from "src/utils/visualFile";
|
import { isVideo } from "src/utils/visualFile";
|
||||||
import { imageTitle } from "src/core/files";
|
import { imageTitle } from "src/core/files";
|
||||||
|
import { galleryTitle } from "src/core/galleries";
|
||||||
|
|
||||||
const CLASSNAME = "Lightbox";
|
const CLASSNAME = "Lightbox";
|
||||||
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
|
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
|
||||||
|
|
@ -62,6 +64,8 @@ const CLASSNAME_OPTIONS_INLINE = `${CLASSNAME_OPTIONS}-inline`;
|
||||||
const CLASSNAME_RIGHT = `${CLASSNAME_HEADER}-right`;
|
const CLASSNAME_RIGHT = `${CLASSNAME_HEADER}-right`;
|
||||||
const CLASSNAME_FOOTER = `${CLASSNAME}-footer`;
|
const CLASSNAME_FOOTER = `${CLASSNAME}-footer`;
|
||||||
const CLASSNAME_FOOTER_LEFT = `${CLASSNAME_FOOTER}-left`;
|
const CLASSNAME_FOOTER_LEFT = `${CLASSNAME_FOOTER}-left`;
|
||||||
|
const CLASSNAME_FOOTER_CENTER = `${CLASSNAME_FOOTER}-center`;
|
||||||
|
const CLASSNAME_FOOTER_RIGHT = `${CLASSNAME_FOOTER}-right`;
|
||||||
const CLASSNAME_DISPLAY = `${CLASSNAME}-display`;
|
const CLASSNAME_DISPLAY = `${CLASSNAME}-display`;
|
||||||
const CLASSNAME_CAROUSEL = `${CLASSNAME}-carousel`;
|
const CLASSNAME_CAROUSEL = `${CLASSNAME}-carousel`;
|
||||||
const CLASSNAME_INSTANT = `${CLASSNAME_CAROUSEL}-instant`;
|
const CLASSNAME_INSTANT = `${CLASSNAME_CAROUSEL}-instant`;
|
||||||
|
|
@ -933,14 +937,30 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className={CLASSNAME_FOOTER_CENTER}>
|
||||||
{currentImage && (
|
{currentImage && (
|
||||||
<Link to={`/images/${currentImage.id}`} onClick={() => close()}>
|
<>
|
||||||
{title ?? ""}
|
<Link
|
||||||
</Link>
|
className="image-link"
|
||||||
|
to={`/images/${currentImage.id}`}
|
||||||
|
onClick={() => close()}
|
||||||
|
>
|
||||||
|
{title ?? ""}
|
||||||
|
</Link>
|
||||||
|
{currentImage.galleries?.length ? (
|
||||||
|
<Link
|
||||||
|
className="image-gallery-link"
|
||||||
|
to={`/galleries/${currentImage.galleries[0].id}`}
|
||||||
|
onClick={() => close()}
|
||||||
|
>
|
||||||
|
<Icon icon={faImages} />
|
||||||
|
{galleryTitle(currentImage.galleries[0])}
|
||||||
|
</Link>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div></div>
|
<div className={CLASSNAME_FOOTER_RIGHT}></div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -105,10 +105,25 @@
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-center {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: 1em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
font-weight: bold;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
|
.fa-icon {
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.image-link {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,17 @@ interface IFiles {
|
||||||
video_codec?: GQL.Maybe<string>;
|
video_codec?: GQL.Maybe<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IWithPath {
|
||||||
|
path: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IGallery {
|
||||||
|
id: string;
|
||||||
|
title?: GQL.Maybe<string>;
|
||||||
|
files?: GQL.Maybe<IWithPath[]>;
|
||||||
|
folder?: GQL.Maybe<IWithPath>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ILightboxImage {
|
export interface ILightboxImage {
|
||||||
id?: string;
|
id?: string;
|
||||||
title?: GQL.Maybe<string>;
|
title?: GQL.Maybe<string>;
|
||||||
|
|
@ -21,6 +32,7 @@ export interface ILightboxImage {
|
||||||
o_counter?: GQL.Maybe<number>;
|
o_counter?: GQL.Maybe<number>;
|
||||||
paths: IImagePaths;
|
paths: IImagePaths;
|
||||||
visual_files?: IFiles[];
|
visual_files?: IFiles[];
|
||||||
|
galleries?: GQL.Maybe<IGallery[]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IChapter {
|
export interface IChapter {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue