BlueWallet/screen/settings/settings.js

41 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-12-13 04:52:54 -05:00
import React, { useContext } from 'react';
import { ScrollView, StyleSheet, StatusBar } from 'react-native';
2020-05-27 14:12:17 +03:00
import { useNavigation } from '@react-navigation/native';
2020-12-25 19:09:53 +03:00
import navigationStyle from '../../components/navigationStyle';
2021-01-05 10:17:04 +03:00
import { BlueListItem, BlueHeaderDefaultSub } from '../../BlueComponents';
2020-07-20 16:38:46 +03:00
import loc from '../../loc';
2020-12-13 04:52:54 -05:00
import { BlueStorageContext } from '../../blue_modules/storage-context';
const styles = StyleSheet.create({
root: {
flex: 1,
},
});
2019-12-24 23:44:33 -06:00
const Settings = () => {
const { navigate } = useNavigation();
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
2020-12-13 04:52:54 -05:00
const { language } = useContext(BlueStorageContext);
2020-07-20 16:38:46 +03:00
return (
2020-07-15 13:32:59 -04:00
<ScrollView style={styles.root}>
<StatusBar barStyle="default" />
2021-01-04 20:44:28 -05:00
<BlueHeaderDefaultSub leftText={loc.settings.header} />
2021-03-01 13:20:01 +03:00
<BlueListItem title={loc.settings.general} onPress={() => navigate('GeneralSettings')} testID="GeneralSettings" chevron />
<BlueListItem title={loc.settings.currency} onPress={() => navigate('Currency')} testID="Currency" chevron />
<BlueListItem title={loc.settings.language} onPress={() => navigate('Language')} testID="Language" chevron />
2020-12-13 04:52:54 -05:00
<BlueListItem title={loc.settings.encrypt_title} onPress={() => navigate('EncryptStorage')} testID="SecurityButton" chevron />
2021-03-01 13:20:01 +03:00
<BlueListItem title={loc.settings.network} onPress={() => navigate('NetworkSettings')} testID="NetworkSettings" chevron />
<BlueListItem title={loc.settings.tools} onPress={() => navigate('Tools')} testID="Tools" chevron />
2020-12-13 04:52:54 -05:00
<BlueListItem title={loc.settings.about} onPress={() => navigate('About')} testID="AboutButton" chevron />
2020-07-15 13:32:59 -04:00
</ScrollView>
);
};
2020-07-15 13:32:59 -04:00
2019-12-24 23:44:33 -06:00
export default Settings;
2020-12-25 19:09:53 +03:00
Settings.navigationOptions = navigationStyle({
2020-11-21 19:57:51 -05:00
headerTitle: '',
});