Browse Source

REF: Move OnLaunch to General

snyk-fix-84644e4a03e171e392ba652f3dc364b5
marcosrdz 5 years ago
parent
commit
2c6ab64474
  1. 14
      screen/settings/GeneralSettings.js
  2. 5
      screen/settings/settings.js

14
screen/settings/GeneralSettings.js

@ -1,10 +1,10 @@
import React, { useEffect, useState } from 'react';
import { ScrollView, Platform } from 'react-native';
import { ScrollView, Platform, TouchableOpacity } from 'react-native';
import { BlueLoading, BlueText, BlueSpacing20, BlueListItem, SafeBlueArea, BlueNavigationStyle, BlueCard } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { AppStorage } from '../../class';
import { useNavigation } from 'react-navigation-hooks';
import HandoffSettings from '../../class/handoff';
let BlueApp: AppStorage = require('../../BlueApp');
let loc = require('../../loc');
@ -12,7 +12,7 @@ const GeneralSettings = () => {
const [isLoading, setIsLoading] = useState(true);
const [isAdancedModeEnabled, setIsAdancedModeEnabled] = useState(false);
const [isHandoffUseEnabled, setIsHandoffUseEnabled] = useState(false);
const { navigate } = useNavigation();
const onAdvancedModeSwitch = async value => {
await BlueApp.setIsAdancedModeEnabled(value);
setIsAdancedModeEnabled(value);
@ -37,6 +37,14 @@ const GeneralSettings = () => {
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}>
<ScrollView>
<BlueCard>
{BlueApp.getWallets().length > 1 && (
<>
<BlueListItem component={TouchableOpacity} onPress={() => navigate('DefaultView')} title="On Launch" />
<BlueCard>
<BlueText>When enabled, BlueWallet will immediately open the selected wallet at launch.</BlueText>
</BlueCard>
</>
)}
{Platform.OS === 'ios' ? (
<>
<BlueListItem

5
screen/settings/settings.js

@ -1,9 +1,7 @@
import React, { useEffect, useState } from 'react';
import { ScrollView, TouchableOpacity } from 'react-native';
import { BlueNavigationStyle, 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 = () => {
@ -21,9 +19,6 @@ const Settings = () => {
<BlueHeaderDefaultSub leftText={loc.settings.header} rightComponent={null} />
<ScrollView>
<BlueListItem title={'General'} component={TouchableOpacity} onPress={() => navigate('GeneralSettings')} />
{BlueApp.getWallets().length > 1 && (
<BlueListItem component={TouchableOpacity} onPress={() => navigate('DefaultView')} title="On Launch" />
)}
<BlueListItem title="Security" onPress={() => navigate('EncryptStorage')} component={TouchableOpacity} testID="SecurityButton" />
<BlueListItem title={loc.settings.lightning_settings} component={TouchableOpacity} onPress={() => navigate('LightningSettings')} />
<BlueListItem title={loc.settings.language} component={TouchableOpacity} onPress={() => navigate('Language')} />

Loading…
Cancel
Save