2024-04-18 03:05:48 +02:00
|
|
|
import React from 'react';
|
2024-05-20 11:54:13 +02:00
|
|
|
import { Platform, ScrollView, StyleSheet } from 'react-native';
|
|
|
|
import ListItem from '../../components/ListItem';
|
|
|
|
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
|
|
|
|
import loc from '../../loc';
|
2024-05-31 19:18:01 +02:00
|
|
|
import { useSettings } from '../../hooks/context/useSettings';
|
2018-09-30 10:31:09 +02:00
|
|
|
|
2020-05-24 11:17:26 +02:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
root: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
2024-03-30 02:22:05 +01:00
|
|
|
container: Platform.select({
|
|
|
|
android: {
|
|
|
|
paddingTop: 50,
|
|
|
|
},
|
|
|
|
default: undefined,
|
|
|
|
}),
|
2020-05-24 11:17:26 +02:00
|
|
|
});
|
|
|
|
|
2019-12-25 06:44:33 +01:00
|
|
|
const Settings = () => {
|
2024-03-30 02:22:05 +01:00
|
|
|
const { navigate } = useExtendedNavigation();
|
2020-12-13 10:52:54 +01:00
|
|
|
// By simply having it here, it'll re-render the UI if language is changed
|
2021-07-17 22:58:24 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2024-04-18 03:05:48 +02:00
|
|
|
const { language } = useSettings();
|
2018-09-30 10:31:09 +02:00
|
|
|
|
2020-07-20 15:38:46 +02:00
|
|
|
return (
|
2024-03-30 02:22:05 +01:00
|
|
|
<ScrollView
|
|
|
|
style={styles.root}
|
|
|
|
contentContainerStyle={styles.container}
|
|
|
|
contentInsetAdjustmentBehavior="automatic"
|
|
|
|
automaticallyAdjustContentInsets
|
|
|
|
>
|
2023-12-16 22:44:35 +01:00
|
|
|
<ListItem title={loc.settings.general} onPress={() => navigate('GeneralSettings')} testID="GeneralSettings" chevron />
|
|
|
|
<ListItem title={loc.settings.currency} onPress={() => navigate('Currency')} testID="Currency" chevron />
|
|
|
|
<ListItem title={loc.settings.language} onPress={() => navigate('Language')} testID="Language" chevron />
|
|
|
|
<ListItem title={loc.settings.encrypt_title} onPress={() => navigate('EncryptStorage')} testID="SecurityButton" chevron />
|
|
|
|
<ListItem title={loc.settings.network} onPress={() => navigate('NetworkSettings')} testID="NetworkSettings" chevron />
|
2024-11-01 03:25:47 +01:00
|
|
|
<ListItem title={loc.settings.tools} onPress={() => navigate('ToolsScreen')} testID="Tools" chevron />
|
2023-12-16 22:44:35 +01:00
|
|
|
<ListItem title={loc.settings.about} onPress={() => navigate('About')} testID="AboutButton" chevron />
|
2023-09-27 02:59:55 +02:00
|
|
|
</ScrollView>
|
2019-10-30 04:00:07 +01:00
|
|
|
);
|
|
|
|
};
|
2020-07-15 19:32:59 +02:00
|
|
|
|
2019-12-25 06:44:33 +01:00
|
|
|
export default Settings;
|