From 439235e6f8d3cd8da8f9bf24ff470398ded4d403 Mon Sep 17 00:00:00 2001 From: Benard Mathu Date: Thu, 27 Jul 2023 18:31:06 +0300 Subject: [PATCH] update: remove arrow function and list button child component text --- src/localisation/lang/en/locale.json | 4 +--- src/localisation/lang/nl/locale.json | 1 - src/localisation/types.ts | 2 -- src/screens/Settings/index.tsx | 25 +++------------------ src/screens/Settings/stacks/timer/Timer.tsx | 2 +- 5 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/localisation/lang/en/locale.json b/src/localisation/lang/en/locale.json index b08ca2b..bbf005b 100644 --- a/src/localisation/lang/en/locale.json +++ b/src/localisation/lang/en/locale.json @@ -41,7 +41,6 @@ "more-info": "More Info", "track": "Track", "playlists": "Playlists", - "timer": "Set Sleep Timer", "playlist": "Playlist", "play-playlist": "Play Playlist", "shuffle-album": "Shuffle Album", @@ -71,6 +70,5 @@ "color-scheme-light": "Light Mode", "color-scheme-dark": "Dark Mode", "artists": "Artists", - "privacy-policy": "Privacy Policy", - "enable-sleeper": "Enable Sleeper" + "privacy-policy": "Privacy Policy" } diff --git a/src/localisation/lang/nl/locale.json b/src/localisation/lang/nl/locale.json index 67cef3e..485d822 100644 --- a/src/localisation/lang/nl/locale.json +++ b/src/localisation/lang/nl/locale.json @@ -41,7 +41,6 @@ "more-info": "Meer informatie", "track": "Track", "playlists": "Playlists", - "timer": "Set Sleep Timer", "playlist": "Playlist", "play-playlist": "Speel Playlist", "shuffle-album": "Shuffle Album", diff --git a/src/localisation/types.ts b/src/localisation/types.ts index ec7dcdd..34e431d 100644 --- a/src/localisation/types.ts +++ b/src/localisation/types.ts @@ -69,5 +69,3 @@ export type LocaleKeys = 'play-next' | 'color-scheme-dark' | 'artists' | 'privacy-policy' -| 'timer' -| 'timer' diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx index d2c87ed..0385548 100644 --- a/src/screens/Settings/index.tsx +++ b/src/screens/Settings/index.tsx @@ -1,5 +1,5 @@ import React, { useCallback } from 'react'; -import { StyleSheet, View } from 'react-native'; +import { StyleSheet } from 'react-native'; import { t } from '@/localisation'; import { createStackNavigator } from '@react-navigation/stack'; import { useNavigation } from '@react-navigation/native'; @@ -17,8 +17,6 @@ import PlaybackReporting from './stacks/PlaybackReporting'; import { SafeScrollView } from '@/components/SafeNavigatorView'; import PrivacyPolicy from './components/PrivacyPolicy'; import Timer from './stacks/timer/Timer'; -import { Paragraph, Text } from '@/components/Typography'; -import { useTypedSelector } from '@/store'; export function SettingsList() { const navigation = useNavigation(); @@ -30,27 +28,10 @@ export function SettingsList() { const handlePrivacyPolicyClick = useCallback(() => { navigation.navigate('PrivacyPolicy'); }, [navigation]); const handleTimerClick = useCallback(() => { navigation.navigate('Timer'); }, [navigation]); - const { sleepTime } = useTypedSelector(state => state.settings); - - const getTime = () => { - let hours = 0; - let minutes = 0; - if (!Number.isNaN(sleepTime)) { - hours = Math.round(sleepTime / 3600); - const timeRemaining = sleepTime % 3600; - - if (timeRemaining >= 60) { - minutes = Math.round(timeRemaining / 60); - } - } - - return `${hours} hrs ${minutes} min`; - } - return ( {t('jellyfin-library')} - {t('timer')} + Set Sleep Timer {t('setting-cache')} {t('error-reporting')} {t('playback-reporting')} @@ -74,7 +55,7 @@ export default function Settings() { }}> - + diff --git a/src/screens/Settings/stacks/timer/Timer.tsx b/src/screens/Settings/stacks/timer/Timer.tsx index de33a03..8696f52 100644 --- a/src/screens/Settings/stacks/timer/Timer.tsx +++ b/src/screens/Settings/stacks/timer/Timer.tsx @@ -79,7 +79,7 @@ function Timer() { value={enableSleeper} onValueChange={(value) => handleEnabledSleeper(value)} /> - {t('enable-sleeper')} + Enable Sleeper