@@ -5,8 +5,10 @@ import { version } from '../../package.json';
6import { useHistory } from 'store/history';
6import { useHistory } from 'store/history';
7import { useWallet } from 'store/wallet';
7import { useWallet } from 'store/wallet';
8+import { usePointCursor } from 'store/pointCursor';
9import { WALLET_TYPES } from 'lib/wallet';
10import { WALLET_TYPES } from 'lib/wallet';
11+import { COMMANDS, useFlowCommand } from 'lib/flowCommand';
11import View from 'components/View';
13import View from 'components/View';
12import Tabs from 'components/Tabs';
14import Tabs from 'components/Tabs';
@@ -43,6 +45,8 @@ export default function Login() {
43 // globals
45 // globals
44 const { pop, push, names } = useHistory();
46 const { pop, push, names } = useHistory();
45 const { walletType } = useWallet();
47 const { walletType } = useWallet();
48+ const { setPointCursor } = usePointCursor();
49+ const flow = useFlowCommand();
48 const [isOther, setisOther] = useState(false);
52 const [isOther, setisOther] = useState(false);
@@ -53,8 +57,22 @@ export default function Login() {
55 const goHome = useCallback(() => {
59 const goHome = useCallback(() => {
56− push(names.POINTS);
61+ push(names.POINTS);
65+ throw new Error('unimplemented flow ' + flow.kind);
57− }, [push, names]);
68+ }, [flow, push, names]);
70+ const flowDescription = command => {
71+ switch (command.kind) {
73+ return <>Flow: {command.kind}</>;
60 <View inset>
78 <View inset>
@@ -65,8 +83,12 @@ export default function Login() {
65 </Grid.Item>
83 </Grid.Item>
66 <Grid.Item as={Text}>Login</Grid.Item>
84 <Grid.Item as={Text}>Login</Grid.Item>
67 </Grid.Item>
85 </Grid.Item>
68− {isOther && <Grid.Item full as={Other} goHome={goHome} />}
86+ {flow && (
87+ <Grid.Item full as={Text} className="t-center mb4">
88+ {flowDescription(flow)}
69− {!isOther && <Grid.Item full as={Ticket} goHome={goHome} />}
91+ <Grid.Item full as={isOther ? Other : Ticket} goHome={goHome} />
70 {!isOther && (
92 {!isOther && (
72 <Grid.Item full className="t-center mv4 gray4">
94 <Grid.Item full className="t-center mv4 gray4">
@@ -80,10 +102,15 @@ export default function Login() {
80 onClick={() => setisOther(true)}>
102 onClick={() => setisOther(true)}>
81 Metamask, Mnemonic, Hardware Wallet...
103 Metamask, Mnemonic, Hardware Wallet...
82 </Grid.Item>
104 </Grid.Item>
108+ onClick={goToActivate}
83− <Grid.Item full onClick={goToActivate} className="mv10 t-center f6">
109+ className="mv10 t-center f6">
84− <span className="gray4">New Urbit ID? </span>
110+ <span className="gray4">New Urbit ID? </span>
85− <LinkButton>Activate</LinkButton>
111+ <LinkButton>Activate</LinkButton>
86− </Grid.Item>
112+ </Grid.Item>
89 {isOther && (
116 {isOther && (