mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-21 06:20:34 -04:00
Add login button instead of watchlist when user is not login
This commit is contained in:
parent
38cb4c4f28
commit
f438e80d3a
@ -24,6 +24,7 @@ import {
|
|||||||
WatchlistKind,
|
WatchlistKind,
|
||||||
WatchlistP,
|
WatchlistP,
|
||||||
getDisplayDate,
|
getDisplayDate,
|
||||||
|
useAccount,
|
||||||
} from "@kyoo/models";
|
} from "@kyoo/models";
|
||||||
import { useYoshiki } from "yoshiki/native";
|
import { useYoshiki } from "yoshiki/native";
|
||||||
import { ItemGrid } from "../browse/grid";
|
import { ItemGrid } from "../browse/grid";
|
||||||
@ -31,14 +32,18 @@ import { InfiniteFetch } from "../fetch-infinite";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Header } from "./genre";
|
import { Header } from "./genre";
|
||||||
import { EpisodeBox, episodeDisplayNumber } from "../details/episode";
|
import { EpisodeBox, episodeDisplayNumber } from "../details/episode";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { Button, P, ts } from "@kyoo/primitives";
|
||||||
|
|
||||||
export const WatchlistList = () => {
|
export const WatchlistList = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { css } = useYoshiki();
|
const { css } = useYoshiki();
|
||||||
|
const account = useAccount();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header title={t("home.watchlist")} />
|
<Header title={t("home.watchlist")} />
|
||||||
|
{account ? (
|
||||||
<InfiniteFetch
|
<InfiniteFetch
|
||||||
query={WatchlistList.query()}
|
query={WatchlistList.query()}
|
||||||
layout={{ ...ItemGrid.layout, layout: "horizontal" }}
|
layout={{ ...ItemGrid.layout, layout: "horizontal" }}
|
||||||
@ -81,6 +86,12 @@ export const WatchlistList = () => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</InfiniteFetch>
|
</InfiniteFetch>
|
||||||
|
) : (
|
||||||
|
<View {...css({ justifyContent: "center", alignItems: "center" })}>
|
||||||
|
<P>{t("home.watchlistLogin")}</P>
|
||||||
|
<Button text={t("login.login")} href={"/login"} {...css({ minWidth: ts(24), margin: ts(2) })}/>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"news": "News",
|
"news": "News",
|
||||||
"watchlist": "Continue watching",
|
"watchlist": "Continue watching",
|
||||||
"info": "See more",
|
"info": "See more",
|
||||||
"none": "No episodes"
|
"none": "No episodes",
|
||||||
|
"watchlistLogin": "To keep track of what you watched or plan to watch, you need to login."
|
||||||
},
|
},
|
||||||
"show": {
|
"show": {
|
||||||
"play": "Play",
|
"play": "Play",
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"news": "Nouveautés",
|
"news": "Nouveautés",
|
||||||
"watchlist": "Continuer de regarder",
|
"watchlist": "Continuer de regarder",
|
||||||
"info": "Voir plus",
|
"info": "Voir plus",
|
||||||
"none": "Aucun episode"
|
"none": "Aucun episode",
|
||||||
|
"watchlistLogin": "Pour suivre ce que vous avez regardé ou prévoyez de regarder, vous devez vous connecter."
|
||||||
},
|
},
|
||||||
"show": {
|
"show": {
|
||||||
"play": "Lecture",
|
"play": "Lecture",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user