BlueWallet/screen/settings/settings.js

41 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-12-13 10:52:54 +01:00
import React, { useContext } from 'react';
import { ScrollView, StyleSheet, StatusBar } from 'react-native';
2020-05-27 13:12:17 +02:00
import { useNavigation } from '@react-navigation/native';
2020-12-25 17:09:53 +01:00
import navigationStyle from '../../components/navigationStyle';
2021-01-05 08:17:04 +01:00
import { BlueListItem, BlueHeaderDefaultSub } from '../../BlueComponents';
2020-07-20 15:38:46 +02:00
import loc from '../../loc';
2020-12-13 10:52:54 +01:00
import { BlueStorageContext } from '../../blue_modules/storage-context';
const styles = StyleSheet.create({
root: {
flex: 1,
},
});
2019-12-25 06:44:33 +01:00
const Settings = () => {
const { navigate } = useNavigation();
2020-12-13 10:52:54 +01:00
// By simply having it here, it'll re-render the UI if language is changed
// eslint-disable-next-line no-unused-vars
const { language } = useContext(BlueStorageContext);
2020-07-20 15:38:46 +02:00
return (
2020-07-15 19:32:59 +02:00
<ScrollView style={styles.root}>
<StatusBar barStyle="default" />
2021-01-05 02:44:28 +01:00
<BlueHeaderDefaultSub leftText={loc.settings.header} />
2021-03-01 11:20:01 +01: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 10:52:54 +01:00
<BlueListItem title={loc.settings.encrypt_title} onPress={() => navigate('EncryptStorage')} testID="SecurityButton" chevron />
2021-03-01 11:20:01 +01: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 10:52:54 +01:00
<BlueListItem title={loc.settings.about} onPress={() => navigate('About')} testID="AboutButton" chevron />
2020-07-15 19:32:59 +02:00
</ScrollView>
);
};
2020-07-15 19:32:59 +02:00
2019-12-25 06:44:33 +01:00
export default Settings;
2020-12-25 17:09:53 +01:00
Settings.navigationOptions = navigationStyle({
2020-11-22 01:57:51 +01:00
headerTitle: '',
});