@@ -1,51 +1,21 @@
11import React, { useCallback, useState } from 'react';
2−import { P, H4, H5, Grid, Text, Button, Flex, LinkButton } from 'indigo-react';
2+import { Grid, Text, Button, Flex, LinkButton } from 'indigo-react';
33
44import { version } from '../../package.json';
55
66import { useHistory } from 'store/history';
7−import { useWallet } from 'store/wallet';
8−import { usePointCursor } from 'store/pointCursor';
97
10−import { WALLET_TYPES } from 'lib/wallet';
118import { COMMANDS, useFlowCommand } from 'lib/flowCommand';
129
1310import View from 'components/View';
14−import Tabs from 'components/Tabs';
15−import Crumbs from 'components/Crumbs';
1611import Footer from 'components/Footer';
17−import { ForwardButton, OfflineButton } from 'components/Buttons';
1812
1913import Ticket from './Login/Ticket';
2014import Other from './Login/Other';
2115
22−const NAMES = {
23− TICKET: 'TICKET',
24− OTHER: 'OTHER',
25−};
26−
27−const VIEWS = {
28− [NAMES.TICKET]: Ticket,
29− [NAMES.OTHER]: Other,
30−};
31−
32−const OPTIONS = [
33− { text: 'Master Ticket', value: NAMES.TICKET },
34− { text: 'Other', value: NAMES.OTHER },
35−];
36−
37−const walletTypeToViewName = walletType => {
38− if (walletType === WALLET_TYPES.TICKET || !walletType) {
39− return NAMES.TICKET;
40− }
41− return NAMES.OTHER;
42−};
43−
4416export default function Login() {
4517 // globals
46− const { pop, push, names } = useHistory();
47− const { walletType } = useWallet();
48− const { setPointCursor } = usePointCursor();
18+ const { push, names } = useHistory();
4919 const flow = useFlowCommand();
5020
5121 // inputs
@@ -63,11 +33,16 @@ export default function Login() {
6333 switch (flow.kind) {
6434 case COMMANDS.TAKE_LOCKUP:
6535 push(names.ACCEPT_LOCKUP);
36+ break;
6637 //
6738 case COMMANDS.BITCOIN:
6839 push(names.BITCOIN_SIGN_TRANSACTION);
6940 break;
7041 //
42+ case COMMANDS.XPUB:
43+ push(names.BITCOIN_XPUB);
44+ break;
45+ //
7146 default:
7247 throw new Error('unimplemented flow ' + flow.kind);
7348 }
@@ -83,6 +58,9 @@ export default function Login() {
8358 case COMMANDS.BITCOIN:
8459 return <>To sign a Bitcoin transaction, please sign in.</>;
8560 //
61+ case COMMANDS.XPUB:
62+ return <>To view your Bitcoin extended public key, please sign in</>;
63+ //
8664 default:
8765 return <>Flow: {command.kind}</>;
8866 }