on 80f2d29 help sign in
bridge/src/views/Network.js
66 lines 1.6 kB history raw
1import React from 'react';
3import { Button } from '../components/old/Base';
4import { InnerLabelDropdown } from '../components/old/Base';
5import { Row, Col, H1, P } from '../components/old/Base';
6import { NETWORK_TYPES, renderNetworkType } from '../lib/network';
7import { ROUTE_NAMES } from '../lib/routeNames';
8import { useHistory } from '../store/history';
9import { useNetwork } from '../store/network';
11const kNetworkOptions = [
12 {
13 title: 'Main Network (default)',
14 value: NETWORK_TYPES.MAINNET,
15 },
16 {
17 title: 'Ropsten',
18 value: NETWORK_TYPES.ROPSTEN,
19 },
20 {
21 title: 'Local Node',
22 value: NETWORK_TYPES.LOCAL,
23 },
24 {
25 type: 'divider',
26 },
27 {
28 title: 'Offline',
29 value: NETWORK_TYPES.OFFLINE,
30 },
31];
33function Network() {
34 const { networkType, setNetworkType } = useNetwork();
35 const history = useHistory();
37 return (
38 <Row>
39 <Col>
40 <H1>{'Select Network'}</H1>
42 <P>
43 {"Please select the Ethereum node you'd like to send " +
44 'transactions to. For highly valuable keys, please select ' +
45 'offline mode.'}
46 </P>
48 <InnerLabelDropdown
49 className={'mt-6'}
50 title={'Node:'}
51 handleUpdate={setNetworkType}
52 options={kNetworkOptions}
53 currentSelectionTitle={renderNetworkType(networkType)}
54 />
56 <Button
57 className={'mt-10'}
58 onClick={() => history.push(ROUTE_NAMES.WALLET)}>
59 {'Continue →'}
60 </Button>
61 </Col>
62 </Row>
63 );
66export default Network;