1import React, { useCallback, useState } from 'react';
2import { H4, Grid } from 'indigo-react';
4import { useHistory } from 'store/history';
5import { useWallet } from 'store/wallet';
7import { WALLET_TYPES } from 'lib/wallet';
9import View from 'components/View';
10import Tabs from 'components/Tabs';
11import Crumbs from 'components/Crumbs';
12import Footer from 'components/Footer';
13import { ForwardButton, OfflineButton } from 'components/Buttons';
15import Ticket from './Login/Ticket';
16import Mnemonic from './Login/Mnemonic';
17import Advanced from './Login/Advanced';
18import Hardware from './Login/Hardware';
28 [NAMES.TICKET]: Ticket,
29 [NAMES.MNEMONIC]: Mnemonic,
30 [NAMES.HARDWARE]: Hardware,
31 [NAMES.ADVANCED]: Advanced,
35 { text: 'Master Ticket', value: NAMES.TICKET },
36 { text: 'Mnemonic', value: NAMES.MNEMONIC },
37 { text: 'Hardware', value: NAMES.HARDWARE },
38 { text: 'Advanced', value: NAMES.ADVANCED },
41const walletTypeToViewName = walletType => {
43 case WALLET_TYPES.MNEMONIC:
44 return NAMES.MNEMONIC;
45 case WALLET_TYPES.LEDGER:
46 case WALLET_TYPES.TREZOR:
47 return NAMES.HARDWARE;
48 case WALLET_TYPES.KEYSTORE:
49 case WALLET_TYPES.PRIVATE_KEY:
50 return NAMES.ADVANCED;
51 case WALLET_TYPES.TICKET:
52 case WALLET_TYPES.SHARDS:
59export default function Login() {
61 const { pop, push, names } = useHistory();
62 const { walletType } = useWallet();
65 const [currentTab, setCurrentTab] = useState(
66 walletTypeToViewName(walletType)
69 const goToActivate = useCallback(() => push(names.ACTIVATE), [
74 const goHome = useCallback(() => {
79 <View pop={pop} inset>
81 <Grid.Item full as={Crumbs} routes={[{ text: 'Bridge' }]} />
82 <Grid.Item full as={H4} className="mt4">
93 currentTab={currentTab}
94 onTabChange={setCurrentTab}
103 <Grid.Item full as={ForwardButton} onClick={goToActivate}>
107 <Grid.Item full as={OfflineButton} />
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list