import React, { useEffect, useState } from 'react'; import { ScrollView, View, Switch, TouchableOpacity } from 'react-native'; import { BlueText, BlueNavigationStyle, BlueCard, BlueLoading, SafeBlueArea, BlueHeaderDefaultSub, BlueListItem, } from '../../BlueComponents'; import { AppStorage } from '../../class'; import { useNavigation } from 'react-navigation-hooks'; const BlueApp: AppStorage = require('../../BlueApp'); const loc = require('../../loc'); const Settings = () => { const [isLoading, setIsLoading] = useState(true); const [showAdvancedOptions, setShowAdvancedOptions] = useState(false); const [advancedModeEnabled, setAdvancedModeEnabled] = useState(false); const { navigate } = useNavigation(); useEffect(() => { (async () => { setAdvancedModeEnabled(await BlueApp.isAdancedModeEnabled()); setIsLoading(false); })(); }); const onAdvancedModeSwitch = async value => { setAdvancedModeEnabled(value); await BlueApp.setIsAdancedModeEnabled(value); }; const onShowAdvancedOptions = () => { setShowAdvancedOptions(!showAdvancedOptions); }; return isLoading ? ( ) : ( {BlueApp.getWallets().length > 1 && ( navigate('DefaultView')} title="On Launch" /> )} navigate('EncryptStorage')} component={TouchableOpacity} testID="SecurityButton" /> navigate('LightningSettings')} /> navigate('Language')} /> navigate('Currency')} /> navigate('ElectrumSettings')} /> {showAdvancedOptions && ( {loc.settings.enable_advanced_mode} )} navigate('About')} testID="AboutButton" /> ); }; Settings.navigationOptions = { ...BlueNavigationStyle, }; export default Settings;