2018-09-30 10:31:09 +02:00
|
|
|
import React, { Component } from 'react';
|
2018-10-29 23:11:48 +01:00
|
|
|
import { ScrollView, TouchableOpacity } from 'react-native';
|
|
|
|
import { BlueLoading, SafeBlueArea, BlueNavigationStyle, BlueHeaderDefaultSub, BlueListItem } from '../../BlueComponents';
|
2018-09-30 10:31:09 +02:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
/** @type {AppStorage} */
|
|
|
|
let BlueApp = require('../../BlueApp');
|
|
|
|
let loc = require('../../loc');
|
|
|
|
|
|
|
|
export default class Settings extends Component {
|
|
|
|
static navigationOptions = {
|
2018-10-29 23:11:48 +01:00
|
|
|
...BlueNavigationStyle,
|
2018-09-30 10:31:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
isLoading: true,
|
|
|
|
language: loc.getLanguage(),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
async componentDidMount() {
|
|
|
|
this.setState({
|
|
|
|
isLoading: false,
|
|
|
|
storageIsEncrypted: await BlueApp.storageIsEncrypted(),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
if (this.state.isLoading) {
|
|
|
|
return <BlueLoading />;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}>
|
|
|
|
<BlueHeaderDefaultSub leftText={loc.settings.header} rightComponent={null} />
|
|
|
|
<ScrollView maxHeight={450}>
|
2018-10-29 23:11:48 +01:00
|
|
|
<TouchableOpacity onPress={() => this.props.navigation.navigate('EncryptStorage')}>
|
|
|
|
<BlueListItem title={loc.settings.encrypt_storage} />
|
|
|
|
</TouchableOpacity>
|
|
|
|
<TouchableOpacity onPress={() => this.props.navigation.navigate('Language')}>
|
2018-10-30 10:35:24 +01:00
|
|
|
<BlueListItem title={loc.settings.language} />
|
2018-10-29 23:11:48 +01:00
|
|
|
</TouchableOpacity>
|
2018-09-30 10:31:09 +02:00
|
|
|
<BlueListItem title={loc.settings.currency} />
|
2018-10-29 23:11:48 +01:00
|
|
|
<TouchableOpacity onPress={() => this.props.navigation.navigate('About')}>
|
|
|
|
<BlueListItem title={loc.settings.about} />
|
|
|
|
</TouchableOpacity>
|
2018-09-30 10:31:09 +02:00
|
|
|
</ScrollView>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings.propTypes = {
|
|
|
|
navigation: PropTypes.shape({
|
|
|
|
navigate: PropTypes.func,
|
|
|
|
goBack: PropTypes.func,
|
|
|
|
}),
|
|
|
|
};
|