diff --git a/package.json b/package.json index 9a35c6f..2e0eed1 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "dependencies": { "@react-native-async-storage/async-storage": "^1.17.11", "@react-native-community/blur": "^4.3.0", - "@react-native-community/checkbox": "^0.5.13", "@react-native-community/netinfo": "^9.3.6", "@react-navigation/bottom-tabs": "^6.4.0", "@react-navigation/elements": "^1.3.17", @@ -47,7 +46,6 @@ "react-native-reanimated": "^3.6.2", "react-native-safe-area-context": "^4.4.1", "react-native-screens": "^3.18.2", - "react-native-select-dropdown": "^3.3.4", "react-native-shadow-2": "^7.0.6", "react-native-skia": "^0.0.1", "react-native-svg": "^13.5.0", diff --git a/src/localisation/lang/en/locale.json b/src/localisation/lang/en/locale.json index 788c9fa..b08ca2b 100644 --- a/src/localisation/lang/en/locale.json +++ b/src/localisation/lang/en/locale.json @@ -71,5 +71,6 @@ "color-scheme-light": "Light Mode", "color-scheme-dark": "Dark Mode", "artists": "Artists", - "privacy-policy": "Privacy Policy" + "privacy-policy": "Privacy Policy", + "enable-sleeper": "Enable Sleeper" } diff --git a/src/localisation/types.ts b/src/localisation/types.ts index 5f85594..ec7dcdd 100644 --- a/src/localisation/types.ts +++ b/src/localisation/types.ts @@ -70,3 +70,4 @@ export type LocaleKeys = 'play-next' | 'artists' | 'privacy-policy' | 'timer' +| 'timer' diff --git a/src/screens/Settings/index.tsx b/src/screens/Settings/index.tsx index 2d5fa28..d2c87ed 100644 --- a/src/screens/Settings/index.tsx +++ b/src/screens/Settings/index.tsx @@ -50,10 +50,7 @@ export function SettingsList() { return ( {t('jellyfin-library')} - - {t('timer')} - {`Set Time: ${getTime()}s`} - + {t('timer')} {t('setting-cache')} {t('error-reporting')} {t('playback-reporting')} diff --git a/src/screens/Settings/stacks/timer/Timer.tsx b/src/screens/Settings/stacks/timer/Timer.tsx index acf14e1..de33a03 100644 --- a/src/screens/Settings/stacks/timer/Timer.tsx +++ b/src/screens/Settings/stacks/timer/Timer.tsx @@ -18,6 +18,9 @@ import SelectDropdown from 'react-native-select-dropdown'; import { time } from 'console'; import CheckBox from '@react-native-community/checkbox'; import TrackPlayer from 'react-native-track-player'; +import { Switch } from 'react-native-gesture-handler'; +import { SwitchContainer, SwitchLabel } from '../../components/Switch'; +import { t } from '@/localisation'; function Timer() { const { sleepTime } = useTypedSelector(state => state.settings); @@ -53,7 +56,7 @@ function Timer() { } return `${hours} hrs ${minutes} min`; - } + }; const handleEnabledSleeper = useCallback((value: boolean) => { dispatch(setEnabledSleeper(value)); @@ -62,8 +65,8 @@ function Timer() { // If value is true sleeper has been enabled, pause then play tack // to trigger play state and start sleeper timer if (value) { - TrackPlayer.pause() - TrackPlayer.play() + TrackPlayer.pause(); + TrackPlayer.play(); } }, [dispatch]); @@ -71,13 +74,13 @@ function Timer() { Set Sleep Timer. Time Set Previously: {getTime()} - - + handleEnabledSleeper(value)} /> - Enable Sleeper - + {t('enable-sleeper')} +