Skip to content

Commit

Permalink
(6) feat: add network settings flow stack (#346)
Browse files Browse the repository at this point in the history
* feat: add NetworkSettingsFlowStack

* chore: add copyright comment

* fix: typo on NetworkSettingsDisclaimer

* lint: resolve lint issues
  • Loading branch information
alexruzenhack authored Oct 25, 2023
1 parent ebc2582 commit 7202b83
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import WalletConnectScan from './screens/WalletConnect/WalletConnectScan';
import baseStyle from './styles/init';
import WalletConnectModal from './components/WalletConnect/WalletConnectModal';
import { COLORS, HathorTheme } from './styles/themes';
import { NetworkSettingsFlowNav, NetworkSettingsFlowStack } from './screens/NetworkSettings';

/**
* This Stack Navigator is exhibited when there is no wallet initialized on the local storage.
Expand Down Expand Up @@ -389,6 +390,7 @@ const AppStack = () => {
<Stack.Screen name='PaymentRequestDetail' component={PaymentRequestDetail} />
<Stack.Screen name='RegisterToken' component={RegisterTokenStack} />
<Stack.Screen name='ChangeToken' component={ChangeToken} />
<Stack.Screen name={NetworkSettingsFlowNav} component={NetworkSettingsFlowStack} />
<Stack.Screen
name='PinScreen'
component={PinScreen}
Expand Down
15 changes: 15 additions & 0 deletions src/screens/NetworkSettings/NetworkSettingsFlowStack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { createStackNavigator } from '@react-navigation/stack';

export const NetworkSettingsFlowNav = Symbol('NetworkSettingsFlowStack').toString();

export const NetworkSettingsFlowStack = ({ navigation }) => {
const FlowStack = createStackNavigator();
return (
<FlowStack.Navigator
initialRouteName='NetworkSettingsDisclaimer'
screenOptions={{
headerShown: false,
}}
/>
);
};
13 changes: 13 additions & 0 deletions src/screens/NetworkSettings/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) Hathor Labs and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { NetworkSettingsFlowStack, NetworkSettingsFlowNav } from './NetworkSettingsFlowStack';

export {
NetworkSettingsFlowStack,
NetworkSettingsFlowNav
};
8 changes: 8 additions & 0 deletions src/screens/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from '../constants';
import CopyClipboard from '../components/CopyClipboard';
import { COLORS } from '../styles/themes';
import { NetworkSettingsFlowNav } from './NetworkSettings';

/**
* selectedToken {Object} Select token config {name, symbol, uid}
Expand Down Expand Up @@ -170,6 +171,13 @@ export class Settings extends React.Component {
/>
</HathorList>

<HathorList title={t`Developer Settings`}>
<ListMenu
title={t`Network Settings`}
onPress={() => this.props.navigation.navigate(NetworkSettingsFlowNav)}
/>
</HathorList>

</ScrollView>
<OfflineBar />
</View>
Expand Down

0 comments on commit 7202b83

Please sign in to comment.