mirror of https://github.com/sussy-code/smov.git
Bookmarks only while browsing
Disabled bookmarks when there is nothing in the search bar.
This commit is contained in:
parent
2b7a054d5f
commit
9a8ecf2e88
|
@ -18,7 +18,7 @@ export const SearchBarInput = forwardRef<HTMLInputElement, SearchBarProps>(
|
|||
const [focused, setFocused] = useState(false);
|
||||
|
||||
function setSearch(value: string) {
|
||||
props.onChange(value, false);
|
||||
props.onChange(value, true);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -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 { useSearchQuery } from "@/hooks/useSearchQuery";
|
||||
import { MediaItem } from "@/utils/mediaTypes";
|
||||
|
||||
import { MediaBookmarkButton } from "./MediaBookmark";
|
||||
|
@ -57,6 +58,8 @@ function MediaCardContent({
|
|||
|
||||
const dotListContent = [t(`media.types.${media.type}`)];
|
||||
|
||||
const [searchQuery] = useSearchQuery();
|
||||
|
||||
if (media.year) {
|
||||
dotListContent.push(media.year.toFixed());
|
||||
}
|
||||
|
@ -142,7 +145,7 @@ function MediaCardContent({
|
|||
</>
|
||||
) : null}
|
||||
|
||||
{canLink ? (
|
||||
{canLink && searchQuery.length > 0 ? (
|
||||
<div className="absolute" onClick={(e) => e.preventDefault()}>
|
||||
<MediaBookmarkButton media={media} />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue