BlueWallet/screen/settings/Settings.js

47 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-04-17 21:05:48 -04:00
import React from 'react';
import { ScrollView, StyleSheet, Platform } from 'react-native';
2023-12-16 17:44:35 -04:00
import { BlueHeaderDefaultSub } from '../../BlueComponents';
2020-07-20 16:38:46 +03:00
import loc from '../../loc';
2023-12-16 17:44:35 -04:00
import ListItem from '../../components/ListItem';
2024-03-29 21:22:05 -04:00
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
2024-04-17 21:05:48 -04:00
import { useSettings } from '../../components/Context/SettingsContext';
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
>
{Platform.OS === 'android' ? <BlueHeaderDefaultSub leftText={loc.settings.header} /> : <></>}
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 />
<ListItem title={loc.settings.tools} onPress={() => navigate('Tools')} testID="Tools" chevron />
<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;