Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc: Deprecate (new) prop & change zoom behaviour. #3

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/components/BackgroundImagePlaceholderDiv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type Props = {
hidePlaceholderOnHover?: boolean;
overlayOnHover?: boolean;
zoomOnHover?: boolean;
zoomOnBoolValue?: boolean;
linkToImage?: boolean;
};

Expand All @@ -24,7 +23,6 @@ const BackgroundImagePlaceholderDiv = React.memo((props: Props) => {
image,
linkToImage,
overlayOnHover,
zoomOnBoolValue,
zoomOnHover,
} = props;
const imageSource = useMemo(() => {
Expand Down Expand Up @@ -88,9 +86,8 @@ const BackgroundImagePlaceholderDiv = React.memo((props: Props) => {
<div
className={cx(
'absolute w-full h-full flex flex-col top-0 left-0 text-center z-[-1] rounded-lg',
zoomOnHover && 'group-hover:scale-105 transition-transform',
typeof zoomOnBoolValue !== 'undefined' && 'transition-transform duration-600',
zoomOnBoolValue && 'scale-105',
typeof zoomOnHover === 'boolean' && 'transition-transform duration-600',
zoomOnHover && 'group-hover:scale-105',
)}
style={{ background: backgroundImage ? `center / cover no-repeat url('${backgroundImage.src}')` : undefined }}
>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/collection/series/SeriesImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ const SeriesImages = () => {
<BackgroundImagePlaceholderDiv
image={item}
className={cx(
'rounded-lg drop-shadow-md transition-transform duration-600 outline',
'rounded-lg drop-shadow-md transition-transform outline',
item === selectedImage
? 'outline-panel-text-important outline-4 '
? 'outline-panel-text-important outline-4'
: 'outline-2 outline-panel-border',
sizeMap[type],
)}
linkToImage
zoomOnBoolValue={item === selectedImage}
zoomOnHover
>
{item.Preferred && (
<div className="absolute bottom-3 mx-[5%] flex w-[90%] justify-center gap-2.5 rounded-lg bg-panel-background-overlay py-2 text-sm font-semibold text-panel-text opacity-100 transition-opacity group-hover:opacity-0">
Expand Down
Loading