1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

always visible when searching, hover to show on homepage

this kind of fixes the ipad problem, because they will see the bookmark when searching, but to edit homepage they will have to use the edit bookmarks button.
This commit is contained in:
Ivan Evans 2024-08-06 12:33:05 -06:00
parent 3dcdcba088
commit 8d0ae1b3b9

View file

@ -7,6 +7,7 @@ import { mediaItemToId } from "@/backend/metadata/tmdb";
import { DotList } from "@/components/text/DotList"; import { DotList } from "@/components/text/DotList";
import { Flare } from "@/components/utils/Flare"; import { Flare } from "@/components/utils/Flare";
import { useIsMobile } from "@/hooks/useIsMobile"; import { useIsMobile } from "@/hooks/useIsMobile";
import { useSearchQuery } from "@/hooks/useSearchQuery";
import { MediaItem } from "@/utils/mediaTypes"; import { MediaItem } from "@/utils/mediaTypes";
import { MediaBookmarkButton } from "./MediaBookmark"; import { MediaBookmarkButton } from "./MediaBookmark";
@ -58,6 +59,8 @@ function MediaCardContent({
const dotListContent = [t(`media.types.${media.type}`)]; const dotListContent = [t(`media.types.${media.type}`)];
const [searchQuery] = useSearchQuery();
const { isMobile } = useIsMobile(); const { isMobile } = useIsMobile();
if (media.year) { if (media.year) {
@ -154,6 +157,12 @@ function MediaCardContent({
<MediaBookmarkButton media={media} /> <MediaBookmarkButton media={media} />
</div> </div>
{searchQuery.length > 0 ? (
<div className="absolute" onClick={(e) => e.preventDefault()}>
<MediaBookmarkButton media={media} />
</div>
) : null}
<div <div
className={`absolute inset-0 flex items-center justify-center bg-mediaCard-badge bg-opacity-80 transition-opacity duration-500 ${ className={`absolute inset-0 flex items-center justify-center bg-mediaCard-badge bg-opacity-80 transition-opacity duration-500 ${
closable ? "opacity-100" : "pointer-events-none opacity-0" closable ? "opacity-100" : "pointer-events-none opacity-0"