BlueWallet/screen/settings/Settings.js

45 lines
1.8 KiB
JavaScript
Raw Normal View History

2024-04-17 21:05:48 -04:00
import React from 'react';
2024-05-20 10:54:13 +01: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 13:18:01 -04:00
import { useSettings } from '../../hooks/context/useSettings';
const styles = StyleSheet.create({
root: {
flex: 1,
},
2024-03-29 21:22:05 -04:00
container: Platform.select({
android: {
paddingTop: 50,
},
default: undefined,
}),
});
2019-12-24 23:44:33 -06:00
const Settings = () => {
2024-03-29 21:22:05 -04:00
const { navigate } = useExtendedNavigation();
2020-12-13 04:52:54 -05: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-17 21:05:48 -04:00
const { language } = useSettings();
2020-07-20 16:38:46 +03:00
return (
2024-03-29 21:22:05 -04:00
<ScrollView
style={styles.root}
contentContainerStyle={styles.container}
contentInsetAdjustmentBehavior="automatic"
automaticallyAdjustContentInsets
>
2023-12-16 17:44:35 -04: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-10-31 22:25:47 -04:00
<ListItem title={loc.settings.tools} onPress={() => navigate('ToolsScreen')} testID="Tools" chevron />
2023-12-16 17:44:35 -04:00
<ListItem title={loc.settings.about} onPress={() => navigate('About')} testID="AboutButton" chevron />
</ScrollView>
);
};
2020-07-15 13:32:59 -04:00
2019-12-24 23:44:33 -06:00
export default Settings;