diff --git a/front/packages/primitives/src/icons.tsx b/front/packages/primitives/src/icons.tsx index 8c924ac0..287c7f8b 100644 --- a/front/packages/primitives/src/icons.tsx +++ b/front/packages/primitives/src/icons.tsx @@ -74,7 +74,7 @@ export const IconButton = forwardRef(function IconButton, ) { - const { css } = useYoshiki(); + const { css, theme } = useYoshiki(); const Container = as ?? PressableFeedback; @@ -98,7 +98,11 @@ export const IconButton = forwardRef(function IconButton - + ); }); diff --git a/front/packages/primitives/src/links.tsx b/front/packages/primitives/src/links.tsx index 5b474556..d93e31e7 100644 --- a/front/packages/primitives/src/links.tsx +++ b/front/packages/primitives/src/links.tsx @@ -23,7 +23,6 @@ import { Platform, Pressable, TextProps, View, PressableProps } from "react-nati import { TextLink, useLink } from "solito/link"; import { useTheme, useYoshiki } from "yoshiki/native"; import { alpha } from "./themes"; -import { NextLink } from "solito/build/link/next-link"; export const A = ({ href, diff --git a/front/packages/ui/src/components/watchlist-info.tsx b/front/packages/ui/src/components/watchlist-info.tsx index 65c17fb8..d5029f5e 100644 --- a/front/packages/ui/src/components/watchlist-info.tsx +++ b/front/packages/ui/src/components/watchlist-info.tsx @@ -18,7 +18,7 @@ * along with Kyoo. If not, see . */ -import { IconButton, tooltip } from "@kyoo/primitives"; +import { Icon, IconButton, tooltip } from "@kyoo/primitives"; import { ComponentProps } from "react"; import { useTranslation } from "react-i18next"; import BookmarkAdd from "@material-symbols/svg-400/rounded/bookmark_add.svg"; @@ -26,7 +26,7 @@ import Bookmark from "@material-symbols/svg-400/rounded/bookmark-fill.svg"; import BookmarkAdded from "@material-symbols/svg-400/rounded/bookmark_added-fill.svg"; import BookmarkRemove from "@material-symbols/svg-400/rounded/bookmark_remove.svg"; import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { WatchStatusV, queryFn } from "@kyoo/models"; +import { WatchStatusV, queryFn, useAccount } from "@kyoo/models"; export const WatchListInfo = ({ type, @@ -39,6 +39,7 @@ export const WatchListInfo = ({ status: WatchStatusV | null; color: ComponentProps["color"]; }) => { + const account = useAccount(); const { t } = useTranslation(); const queryClient = useQueryClient(); @@ -50,8 +51,17 @@ export const WatchListInfo = ({ }), onSettled: async () => await queryClient.invalidateQueries({ queryKey: [type, slug] }), }); - if (mutation.isPending) status = mutation.variables; + + if (account == null) { + return + } + switch (status) { case null: return ( diff --git a/front/translations/en.json b/front/translations/en.json index 6722fe92..655c90e2 100644 --- a/front/translations/en.json +++ b/front/translations/en.json @@ -22,7 +22,8 @@ "partOf": "Part of the", "watchlistAdd": "Add to your plan to watch list", "watchlistEdit": "Edit watch status", - "watchlistRemove": "Mark as not seen" + "watchlistRemove": "Mark as not seen", + "watchlistLogin": "Login to add to your watchlist" }, "browse": { "sortby": "Sort by {{key}}", diff --git a/front/translations/fr.json b/front/translations/fr.json index c63e2b7f..71725641 100644 --- a/front/translations/fr.json +++ b/front/translations/fr.json @@ -22,7 +22,8 @@ "partOf": "Fait parti de", "watchlistAdd": "Ajouter à votre liste de visionnage", "watchlistEdit": "Editer le status", - "watchlistRemove": "Marquer comme non vu" + "watchlistRemove": "Marquer comme non vu", + "watchlistLogin": "Connectez-vous pour ajouter a votre liste de visionnage" }, "browse": { "sortby": "Trier par {{key}}",