mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
More settings + language component spacing
This commit is contained in:
@@ -4,6 +4,7 @@ import { useJellyfinDiscovery } from "@/hooks/useJellyfinDiscovery";
|
||||
import { Button } from "./Button";
|
||||
import { ListGroup } from "./list/ListGroup";
|
||||
import { ListItem } from "./list/ListItem";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface Props {
|
||||
onServerSelect?: (server: { address: string; serverName?: string }) => void;
|
||||
@@ -11,17 +12,18 @@ interface Props {
|
||||
|
||||
const JellyfinServerDiscovery: React.FC<Props> = ({ onServerSelect }) => {
|
||||
const { servers, isSearching, startDiscovery } = useJellyfinDiscovery();
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<View className="mt-2">
|
||||
<Button onPress={startDiscovery} color="black">
|
||||
<Text className="text-white text-center">
|
||||
{isSearching ? "Searching..." : "Search for local servers"}
|
||||
{isSearching ? t("server.searching") : t("server.search_for_local_servers")}
|
||||
</Text>
|
||||
</Button>
|
||||
|
||||
{servers.length ? (
|
||||
<ListGroup title="Servers" className="mt-4">
|
||||
<ListGroup title={t("server.servers")} className="mt-4">
|
||||
{servers.map((server) => (
|
||||
<ListItem
|
||||
key={server.address}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useAtom } from "jotai";
|
||||
import { useMemo } from "react";
|
||||
import { TouchableOpacityProps, View } from "react-native";
|
||||
import { TouchableItemRouter } from "../common/TouchableItemRouter";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface Props extends TouchableOpacityProps {
|
||||
library: BaseItemDto;
|
||||
@@ -42,6 +43,8 @@ export const LibraryItemCard: React.FC<Props> = ({ library, ...props }) => {
|
||||
const [user] = useAtom(userAtom);
|
||||
const [settings] = useSettings();
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const url = useMemo(
|
||||
() =>
|
||||
getPrimaryImageUrl({
|
||||
@@ -69,13 +72,13 @@ export const LibraryItemCard: React.FC<Props> = ({ library, ...props }) => {
|
||||
let nameStr: string;
|
||||
|
||||
if (library.CollectionType === "movies") {
|
||||
nameStr = "movies";
|
||||
nameStr = t("library.item_types.movies");
|
||||
} else if (library.CollectionType === "tvshows") {
|
||||
nameStr = "series";
|
||||
nameStr = t("library.item_types.series");
|
||||
} else if (library.CollectionType === "boxsets") {
|
||||
nameStr = "box sets";
|
||||
nameStr = t("library.item_types.boxsets");
|
||||
} else {
|
||||
nameStr = "items";
|
||||
nameStr = t("library.item_types.items");
|
||||
}
|
||||
|
||||
return nameStr;
|
||||
|
||||
@@ -47,7 +47,7 @@ export const AudioToggles: React.FC<Props> = ({ ...props }) => {
|
||||
<DropdownMenu.Trigger>
|
||||
<TouchableOpacity className="flex flex-row items-center justify-between py-3 pl-3 ">
|
||||
<Text className="mr-1 text-[#8E8D91]">
|
||||
{settings?.defaultAudioLanguage?.DisplayName || "None"}
|
||||
{settings?.defaultAudioLanguage?.DisplayName || t("home.settings.audio.none")}
|
||||
</Text>
|
||||
<Ionicons
|
||||
name="chevron-expand-sharp"
|
||||
@@ -65,7 +65,7 @@ export const AudioToggles: React.FC<Props> = ({ ...props }) => {
|
||||
collisionPadding={8}
|
||||
sideOffset={8}
|
||||
>
|
||||
<DropdownMenu.Label>Languages</DropdownMenu.Label>
|
||||
<DropdownMenu.Label>{t("home.settings.audio.language")}</DropdownMenu.Label>
|
||||
<DropdownMenu.Item
|
||||
key={"none-audio"}
|
||||
onSelect={() => {
|
||||
|
||||
@@ -61,7 +61,7 @@ export const DownloadSettings: React.FC = ({ ...props }) => {
|
||||
collisionPadding={8}
|
||||
sideOffset={8}
|
||||
>
|
||||
<DropdownMenu.Label>Methods</DropdownMenu.Label>
|
||||
<DropdownMenu.Label>{t("home.settings.downloads.methods")}</DropdownMenu.Label>
|
||||
<DropdownMenu.Item
|
||||
key="1"
|
||||
onSelect={() => {
|
||||
@@ -69,7 +69,7 @@ export const DownloadSettings: React.FC = ({ ...props }) => {
|
||||
setProcesses([]);
|
||||
}}
|
||||
>
|
||||
<DropdownMenu.ItemTitle>Default</DropdownMenu.ItemTitle>
|
||||
<DropdownMenu.ItemTitle>{t("home.settings.downloads.default")}</DropdownMenu.ItemTitle>
|
||||
</DropdownMenu.Item>
|
||||
<DropdownMenu.Item
|
||||
key="2"
|
||||
@@ -79,7 +79,7 @@ export const DownloadSettings: React.FC = ({ ...props }) => {
|
||||
queryClient.invalidateQueries({ queryKey: ["search"] });
|
||||
}}
|
||||
>
|
||||
<DropdownMenu.ItemTitle>Optimized</DropdownMenu.ItemTitle>
|
||||
<DropdownMenu.ItemTitle>{t("home.settings.downloads.optimized")}</DropdownMenu.ItemTitle>
|
||||
</DropdownMenu.Item>
|
||||
</DropdownMenu.Content>
|
||||
</DropdownMenu.Root>
|
||||
|
||||
@@ -37,7 +37,7 @@ export const MediaToggles: React.FC<Props> = ({ ...props }) => {
|
||||
value={settings.forwardSkipTime}
|
||||
disabled={pluginSettings?.forwardSkipTime?.locked}
|
||||
step={5}
|
||||
appendValue="s"
|
||||
appendValue={t("home.settings.media_controls.seconds_unit")}
|
||||
min={0}
|
||||
max={60}
|
||||
onUpdate={(forwardSkipTime) => updateSettings({forwardSkipTime})}
|
||||
@@ -52,7 +52,7 @@ export const MediaToggles: React.FC<Props> = ({ ...props }) => {
|
||||
value={settings.rewindSkipTime}
|
||||
disabled={pluginSettings?.rewindSkipTime?.locked}
|
||||
step={5}
|
||||
appendValue="s"
|
||||
appendValue={t("home.settings.media_controls.seconds_unit")}
|
||||
min={0}
|
||||
max={60}
|
||||
onUpdate={(rewindSkipTime) => updateSettings({rewindSkipTime})}
|
||||
|
||||
@@ -147,11 +147,11 @@ export const OtherSettings: React.FC = () => {
|
||||
</ListItem>
|
||||
<ListItem
|
||||
onPress={() => router.push("/settings/hide-libraries/page")}
|
||||
title="Hide Libraries"
|
||||
title={t("home.settings.other.hide_libraries")}
|
||||
showArrow
|
||||
/>
|
||||
<ListItem
|
||||
title="Disable Haptic Feedback"
|
||||
title={t("home.settings.other.disable_haptic_feedback")}
|
||||
disabled={pluginSettings?.disableHapticFeedback?.locked}
|
||||
>
|
||||
<Switch
|
||||
|
||||
@@ -16,7 +16,7 @@ export const PluginSettings = () => {
|
||||
if (!settings) return null;
|
||||
return (
|
||||
<View>
|
||||
<ListGroup title={t("home.settings.plugins.plugins_title")}>
|
||||
<ListGroup title={t("home.settings.plugins.plugins_title")} className="mb-4">
|
||||
<ListItem
|
||||
onPress={() => router.push("/settings/jellyseerr/page")}
|
||||
title={"Jellyseerr"}
|
||||
|
||||
@@ -65,7 +65,7 @@ export const QuickConnect: React.FC<Props> = ({ ...props }) => {
|
||||
|
||||
return (
|
||||
<View {...props}>
|
||||
<ListGroup title={"Quick Connect"}>
|
||||
<ListGroup title={t("home.settings.quick_connect.quick_connect_title")}>
|
||||
<ListItem
|
||||
onPress={() => bottomSheetModalRef?.current?.present()}
|
||||
title={t("home.settings.quick_connect.authorize_button")}
|
||||
@@ -96,7 +96,7 @@ export const QuickConnect: React.FC<Props> = ({ ...props }) => {
|
||||
<BottomSheetTextInput
|
||||
style={{ color: "white" }}
|
||||
clearButtonMode="always"
|
||||
placeholder="Enter the quick connect code..."
|
||||
placeholder={t("home.settings.quick_connect.enter_the_quick_connect_code")}
|
||||
placeholderTextColor="#9CA3AF"
|
||||
value={quickConnectCode}
|
||||
onChangeText={setQuickConnectCode}
|
||||
@@ -108,7 +108,7 @@ export const QuickConnect: React.FC<Props> = ({ ...props }) => {
|
||||
onPress={authorizeQuickConnect}
|
||||
color="purple"
|
||||
>
|
||||
Authorize
|
||||
{t("home.settings.quick_connect.authorize")}
|
||||
</Button>
|
||||
</View>
|
||||
</BottomSheetView>
|
||||
|
||||
@@ -43,7 +43,7 @@ export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
|
||||
>
|
||||
<ListItem title={t("home.settings.subtitles.subtitle_language")}>
|
||||
<Dropdown
|
||||
data={[{DisplayName: "None", ThreeLetterISOLanguageName: "none-subs" },...(cultures ?? [])]}
|
||||
data={[{DisplayName: t("home.settings.subtitles.none"), ThreeLetterISOLanguageName: "none-subs" },...(cultures ?? [])]}
|
||||
keyExtractor={(item) => item?.ThreeLetterISOLanguageName ?? "unknown"}
|
||||
titleExtractor={(item) => item?.DisplayName}
|
||||
title={
|
||||
@@ -58,7 +58,7 @@ export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
}
|
||||
label="Languages"
|
||||
label={t("home.settings.subtitles.language")}
|
||||
onSelected={(defaultSubtitleLanguage) =>
|
||||
updateSettings({
|
||||
defaultSubtitleLanguage: defaultSubtitleLanguage.DisplayName === t("home.settings.subtitles.none")
|
||||
@@ -81,7 +81,7 @@ export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
|
||||
title={
|
||||
<TouchableOpacity className="flex flex-row items-center justify-between py-3 pl-3">
|
||||
<Text className="mr-1 text-[#8E8D91]">
|
||||
{settings?.subtitleMode || "Loading"}
|
||||
{settings?.subtitleMode || t("home.settings.subtitles.loading")}
|
||||
</Text>
|
||||
<Ionicons
|
||||
name="chevron-expand-sharp"
|
||||
@@ -90,7 +90,7 @@ export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
}
|
||||
label="Subtitle Mode"
|
||||
label={t("home.settings.subtitles.subtitle_mode")}
|
||||
onSelected={(subtitleMode) =>
|
||||
updateSettings({subtitleMode})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user