Add about tab on the settings page

This commit is contained in:
Zoe Roux 2024-01-10 21:45:28 +01:00
parent c528d4dd78
commit b97942b10f
3 changed files with 38 additions and 10 deletions

View File

@ -21,10 +21,7 @@
import {
Account,
KyooErrors,
QueryIdentifier,
QueryPage,
User,
UserP,
deleteAccount,
logout,
queryFn,
@ -40,6 +37,7 @@ import {
HR,
Icon,
Input,
Link,
P,
Popup,
Select,
@ -62,6 +60,8 @@ import Mail from "@material-symbols/svg-400/outlined/mail.svg";
import Password from "@material-symbols/svg-400/outlined/password.svg";
import Logout from "@material-symbols/svg-400/rounded/logout.svg";
import Delete from "@material-symbols/svg-400/rounded/delete.svg";
import Android from "@material-symbols/svg-400/rounded/android.svg";
import Public from "@material-symbols/svg-400/rounded/public.svg";
const Preference = ({
icon,
@ -385,11 +385,6 @@ const AccountSettings = ({ setPopup }: { setPopup: (e?: ReactElement) => void })
);
};
const query: QueryIdentifier<User> = {
parser: UserP,
path: ["auth", "me"],
};
export const SettingsPage: QueryPage = () => {
const { t } = useTranslation();
const [popup, setPopup] = useState<ReactElement | undefined>(undefined);
@ -414,6 +409,22 @@ export const SettingsPage: QueryPage = () => {
</Preference>
</SettingsContainer>
<AccountSettings setPopup={setPopup} />
<SettingsContainer title={t("settings.about.label")}>
<Link href="https://github.com/zoriya/kyoo/releases/latest/download/kyoo.apk" target="_blank">
<Preference
icon={Android}
label={t("settings.about.android-app.label")}
description={t("settings.about.android-app.description")}
/>
</Link>
<Link href="https://github.com/zoriya/kyoo" target="_blank">
<Preference
icon={Public}
label={t("settings.about.git.label")}
description={t("settings.about.git.description")}
/>
</Link>
</SettingsContainer>
</ScrollView>
{popup}
</>
@ -421,5 +432,3 @@ export const SettingsPage: QueryPage = () => {
};
SettingsPage.getLayout = DefaultLayout;
SettingsPage.getFetchUrls = () => [query];

View File

@ -91,6 +91,10 @@
"username": {
"label": "Username"
},
"avatar": {
"label": "Avatar",
"description": "Change your profile icon"
},
"email": {
"label": "Email"
},
@ -100,6 +104,17 @@
"oldPassword": "Old password",
"newPassword": "New password"
}
},
"about": {
"label": "About",
"android-app": {
"label": "Android app",
"description": "Download the android app"
},
"git": {
"label": "Github",
"description": "Open the github repository where you can browse the code of kyoo"
}
}
},
"player": {

View File

@ -91,6 +91,10 @@
"username": {
"label": "Nom d'utilisateur"
},
"avatar": {
"label": "Avatar",
"description": "Changez votre photo de profil"
},
"email": {
"label": "Email"
},