Skip to content

Commit

Permalink
Merge branch 'sussy-code:main' into pwa-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Pasithea0 authored Aug 24, 2024
2 parents d6a2b91 + fa08d41 commit 1e4ec0c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/media/MediaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
import { mediaItemToId } from "@/backend/metadata/tmdb";
import { DotList } from "@/components/text/DotList";
import { Flare } from "@/components/utils/Flare";
import { useIsMobile } from "@/hooks/useIsMobile";
import { useSearchQuery } from "@/hooks/useSearchQuery";
import { MediaItem } from "@/utils/mediaTypes";

Expand Down Expand Up @@ -60,6 +61,8 @@ function MediaCardContent({

const [searchQuery] = useSearchQuery();

const { isMobile } = useIsMobile();

if (media.year) {
dotListContent.push(media.year.toFixed());
}
Expand Down Expand Up @@ -145,6 +148,15 @@ function MediaCardContent({
</>
) : null}

<div
className={classNames("absolute", {
"bookmark-button": !isMobile,
})}
onClick={(e) => e.preventDefault()}
>
<MediaBookmarkButton media={media} />
</div>

{searchQuery.length > 0 ? (
<div className="absolute" onClick={(e) => e.preventDefault()}>
<MediaBookmarkButton media={media} />
Expand Down
9 changes: 9 additions & 0 deletions src/components/utils/Flare.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
.hover\:flare-enabled:hover .flare-light {
opacity: 1 !important;
}

.bookmark-button {
opacity: 0;
transition: opacity 0.3s;
}

.group:hover .bookmark-button {
opacity: 1;
}

0 comments on commit 1e4ec0c

Please sign in to comment.