2019-12-24 23:44:33 -06:00
|
|
|
import React, { useEffect, useState } from 'react';
|
2020-03-28 22:06:45 -04:00
|
|
|
import { ScrollView, TouchableOpacity } from 'react-native';
|
|
|
|
import { BlueNavigationStyle, BlueLoading, SafeBlueArea, BlueHeaderDefaultSub, BlueListItem } from '../../BlueComponents';
|
2019-10-29 23:00:07 -04:00
|
|
|
import { useNavigation } from 'react-navigation-hooks';
|
|
|
|
const loc = require('../../loc');
|
2018-09-30 04:31:09 -04:00
|
|
|
|
2019-12-24 23:44:33 -06:00
|
|
|
const Settings = () => {
|
2019-10-29 23:00:07 -04:00
|
|
|
const [isLoading, setIsLoading] = useState(true);
|
|
|
|
const { navigate } = useNavigation();
|
2018-09-30 04:31:09 -04:00
|
|
|
|
2019-10-29 23:00:07 -04:00
|
|
|
useEffect(() => {
|
2020-03-28 22:06:45 -04:00
|
|
|
setIsLoading(false);
|
2019-10-29 23:00:07 -04:00
|
|
|
});
|
2018-09-30 04:31:09 -04:00
|
|
|
|
2019-10-29 23:00:07 -04:00
|
|
|
return isLoading ? (
|
|
|
|
<BlueLoading />
|
|
|
|
) : (
|
|
|
|
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}>
|
|
|
|
<BlueHeaderDefaultSub leftText={loc.settings.header} rightComponent={null} />
|
|
|
|
<ScrollView>
|
2020-03-28 22:06:45 -04:00
|
|
|
<BlueListItem title={'General'} component={TouchableOpacity} onPress={() => navigate('GeneralSettings')} />
|
2019-10-29 23:00:07 -04:00
|
|
|
<BlueListItem title={loc.settings.currency} component={TouchableOpacity} onPress={() => navigate('Currency')} />
|
2020-03-29 23:41:02 -04:00
|
|
|
<BlueListItem title={loc.settings.language} component={TouchableOpacity} onPress={() => navigate('Language')} />
|
|
|
|
<BlueListItem title="Security" onPress={() => navigate('EncryptStorage')} component={TouchableOpacity} testID="SecurityButton" />
|
|
|
|
<BlueListItem title="Network" component={TouchableOpacity} onPress={() => navigate('NetworkSettings')} />
|
2020-03-19 15:51:35 +00:00
|
|
|
<BlueListItem title={loc.settings.about} component={TouchableOpacity} onPress={() => navigate('About')} testID="AboutButton" />
|
2019-10-29 23:00:07 -04:00
|
|
|
</ScrollView>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
};
|
2019-12-24 23:44:33 -06:00
|
|
|
Settings.navigationOptions = {
|
|
|
|
...BlueNavigationStyle,
|
|
|
|
};
|
|
|
|
export default Settings;
|