2020-12-13 04:52:54 -05:00
|
|
|
import React, { useContext } from 'react';
|
2023-09-26 19:59:55 -05:00
|
|
|
import { ScrollView, StyleSheet, Platform } 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';
|
2018-09-30 04:31:09 -04:00
|
|
|
|
2020-05-24 12:17:26 +03:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
root: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-12-24 23:44:33 -06:00
|
|
|
const Settings = () => {
|
2019-10-29 23:00:07 -04:00
|
|
|
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);
|
2018-09-30 04:31:09 -04:00
|
|
|
|
2020-07-20 16:38:46 +03:00
|
|
|
return (
|
2023-09-26 19:59:55 -05:00
|
|
|
<ScrollView style={styles.root} contentInsetAdjustmentBehavior="automatic" automaticallyAdjustContentInsets>
|
|
|
|
{Platform.OS === 'android' ? <BlueHeaderDefaultSub leftText={loc.settings.header} /> : <></>}
|
|
|
|
<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 />
|
|
|
|
<BlueListItem title={loc.settings.encrypt_title} onPress={() => navigate('EncryptStorage')} testID="SecurityButton" chevron />
|
|
|
|
<BlueListItem title={loc.settings.network} onPress={() => navigate('NetworkSettings')} testID="NetworkSettings" chevron />
|
|
|
|
<BlueListItem title={loc.settings.tools} onPress={() => navigate('Tools')} testID="Tools" chevron />
|
|
|
|
<BlueListItem title={loc.settings.about} onPress={() => navigate('About')} testID="AboutButton" chevron />
|
|
|
|
</ScrollView>
|
2019-10-29 23:00:07 -04:00
|
|
|
);
|
|
|
|
};
|
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({
|
2021-09-13 13:43:26 -04:00
|
|
|
headerTitle: Platform.select({ ios: loc.settings.header, default: '' }),
|
|
|
|
headerLargeTitle: true,
|
2020-11-21 19:57:51 -05:00
|
|
|
});
|