mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import * as Application from "expo-application";
|
|
import { useAtom } from "jotai";
|
|
import { useTranslation } from "react-i18next";
|
|
import { View, type ViewProps } from "react-native";
|
|
import { apiAtom, userAtom } from "@/providers/JellyfinProvider";
|
|
import { ListGroup } from "../list/ListGroup";
|
|
import { ListItem } from "../list/ListItem";
|
|
|
|
interface Props extends ViewProps {}
|
|
|
|
export const UserInfo: React.FC<Props> = ({ ...props }) => {
|
|
const [api] = useAtom(apiAtom);
|
|
const [user] = useAtom(userAtom);
|
|
const { t } = useTranslation();
|
|
|
|
const version =
|
|
Application?.nativeApplicationVersion ||
|
|
Application?.nativeBuildVersion ||
|
|
"N/A";
|
|
|
|
return (
|
|
<View {...props}>
|
|
<ListGroup title={t("home.settings.user_info.user_info_title")}>
|
|
<ListItem
|
|
title={t("home.settings.user_info.user")}
|
|
value={user?.Name}
|
|
/>
|
|
<ListItem
|
|
title={t("home.settings.user_info.server")}
|
|
value={api?.basePath}
|
|
/>
|
|
<ListItem
|
|
title={t("home.settings.user_info.token")}
|
|
value={api?.accessToken}
|
|
/>
|
|
<ListItem
|
|
title={t("home.settings.user_info.app_version")}
|
|
value={version}
|
|
/>
|
|
</ListGroup>
|
|
</View>
|
|
);
|
|
};
|