Skip to content

Commit

Permalink
Merge pull request #82 from Pasithea0/bookmarks-always-visible
Browse files Browse the repository at this point in the history
Change bookmark button to always visible
  • Loading branch information
itzCozi authored Aug 20, 2024
2 parents b617939 + 8d0ae1b commit fa08d41
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 fa08d41

Please sign in to comment.