mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Support image clips/gifs (#3583)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -425,20 +425,25 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
const navItems = images.map((image, i) => (
|
||||
<img
|
||||
src={image.paths.thumbnail ?? ""}
|
||||
alt=""
|
||||
className={cx(CLASSNAME_NAVIMAGE, {
|
||||
const navItems = images.map((image, i) =>
|
||||
React.createElement(image.paths.preview != "" ? "video" : "img", {
|
||||
loop: image.paths.preview != "",
|
||||
autoPlay: image.paths.preview != "",
|
||||
src:
|
||||
image.paths.preview != ""
|
||||
? image.paths.preview ?? ""
|
||||
: image.paths.thumbnail ?? "",
|
||||
alt: "",
|
||||
className: cx(CLASSNAME_NAVIMAGE, {
|
||||
[CLASSNAME_NAVSELECTED]: i === index,
|
||||
})}
|
||||
onClick={(e: React.MouseEvent) => selectIndex(e, i)}
|
||||
role="presentation"
|
||||
loading="lazy"
|
||||
key={image.paths.thumbnail}
|
||||
onLoad={imageLoaded}
|
||||
/>
|
||||
));
|
||||
}),
|
||||
onClick: (e: React.MouseEvent) => selectIndex(e, i),
|
||||
role: "presentation",
|
||||
loading: "lazy",
|
||||
key: image.paths.thumbnail,
|
||||
onLoad: imageLoaded,
|
||||
})
|
||||
);
|
||||
|
||||
const onDelayChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
let numberValue = Number.parseInt(e.currentTarget.value, 10);
|
||||
@@ -845,6 +850,7 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||
scrollAttemptsBeforeChange={scrollAttemptsBeforeChange}
|
||||
setZoom={(v) => setZoom(v)}
|
||||
resetPosition={resetPosition}
|
||||
isVideo={image.visual_files?.[0]?.__typename == "VideoFile"}
|
||||
/>
|
||||
) : undefined}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user