BlueWallet/screen/settings/Settings.js

45 lines
1.8 KiB
JavaScript
Raw Normal View History

2024-04-18 03:05:48 +02:00
import React from 'react';
2024-05-20 11:54:13 +02: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 19:18:01 +02:00
import { useSettings } from '../../hooks/context/useSettings';
const styles = StyleSheet.create({
root: {
flex: 1,
},
2024-03-30 02:22:05 +01:00
container: Platform.select({
android: {
paddingTop: 50,
},
default: undefined,
}),
});
2019-12-25 06:44:33 +01:00
const Settings = () => {
2024-03-30 02:22:05 +01:00
const { navigate } = useExtendedNavigation();
2020-12-13 10:52:54 +01: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-18 03:05:48 +02:00
const { language } = useSettings();
2020-07-20 15:38:46 +02:00
return (
2024-03-30 02:22:05 +01:00
<ScrollView
style={styles.root}
contentContainerStyle={styles.container}
contentInsetAdjustmentBehavior="automatic"
automaticallyAdjustContentInsets
>
2023-12-16 22:44:35 +01: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 19:32:59 +02:00
2019-12-25 06:44:33 +01:00
export default Settings;