mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 12:14:46 -04:00
Add download option on contextual menues
This commit is contained in:
parent
2603c1b29d
commit
b51c77dfa7
@ -23,9 +23,11 @@ import { ComponentProps } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import MoreVert from "@material-symbols/svg-400/rounded/more_vert.svg";
|
import MoreVert from "@material-symbols/svg-400/rounded/more_vert.svg";
|
||||||
import Info from "@material-symbols/svg-400/rounded/info.svg";
|
import Info from "@material-symbols/svg-400/rounded/info.svg";
|
||||||
|
import Download from "@material-symbols/svg-400/rounded/download.svg";
|
||||||
import { WatchStatusV, queryFn, useAccount } from "@kyoo/models";
|
import { WatchStatusV, queryFn, useAccount } from "@kyoo/models";
|
||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { watchListIcon } from "./watchlist-info";
|
import { watchListIcon } from "./watchlist-info";
|
||||||
|
import { downloadFile } from "../downloads/download";
|
||||||
|
|
||||||
export const EpisodesContext = ({
|
export const EpisodesContext = ({
|
||||||
type = "episode",
|
type = "episode",
|
||||||
@ -74,6 +76,13 @@ export const EpisodesContext = ({
|
|||||||
<Menu.Item label={t("show.watchlistMark.null")} onSelect={() => mutation.mutate(null)} />
|
<Menu.Item label={t("show.watchlistMark.null")} onSelect={() => mutation.mutate(null)} />
|
||||||
)}
|
)}
|
||||||
</Menu.Sub>
|
</Menu.Sub>
|
||||||
|
{type !== "show" && (
|
||||||
|
<Menu.Item
|
||||||
|
label={t("home.episodeMore.download")}
|
||||||
|
icon={Download}
|
||||||
|
onSelect={() => downloadFile(type, slug)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
"none": "No episodes",
|
"none": "No episodes",
|
||||||
"watchlistLogin": "To keep track of what you watched or plan to watch, you need to login.",
|
"watchlistLogin": "To keep track of what you watched or plan to watch, you need to login.",
|
||||||
"episodeMore": {
|
"episodeMore": {
|
||||||
"goToShow": "Go to show"
|
"goToShow": "Go to show",
|
||||||
|
"download": "Download"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"show": {
|
"show": {
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
"none": "Aucun episode",
|
"none": "Aucun episode",
|
||||||
"watchlistLogin": "Pour suivre ce que vous avez regardé ou prévoyez de regarder, vous devez vous connecter.",
|
"watchlistLogin": "Pour suivre ce que vous avez regardé ou prévoyez de regarder, vous devez vous connecter.",
|
||||||
"episodeMore": {
|
"episodeMore": {
|
||||||
"goToShow": "Aller a la serie"
|
"goToShow": "Aller a la serie",
|
||||||
|
"download": "Télécharger"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"show": {
|
"show": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user