@@ -5,8 +5,10 @@ import { version } from '../../package.json';
55
66import { useHistory } from 'store/history';
77import { useWallet } from 'store/wallet';
8+import { usePointCursor } from 'store/pointCursor';
89
910import { WALLET_TYPES } from 'lib/wallet';
11+import { COMMANDS, useFlowCommand } from 'lib/flowCommand';
1012
1113import View from 'components/View';
1214import Tabs from 'components/Tabs';
@@ -43,6 +45,8 @@ export default function Login() {
4345 // globals
4446 const { pop, push, names } = useHistory();
4547 const { walletType } = useWallet();
48+ const { setPointCursor } = usePointCursor();
49+ const flow = useFlowCommand();
4650
4751 // inputs
4852 const [isOther, setisOther] = useState(false);
@@ -53,8 +57,22 @@ export default function Login() {
5357 ]);
5458
5559 const goHome = useCallback(() => {
56− push(names.POINTS);
57− }, [push, names]);
60+ if (!flow) {
61+ push(names.POINTS);
62+ } else {
63+ switch (flow.kind) {
64+ default:
65+ throw new Error('unimplemented flow ' + flow.kind);
66+ }
67+ }
68+ }, [flow, push, names]);
69+
70+ const flowDescription = command => {
71+ switch (command.kind) {
72+ default:
73+ return <>Flow: {command.kind}</>;
74+ }
75+ };
5876
5977 return (
6078 <View inset>
@@ -65,8 +83,12 @@ export default function Login() {
6583 </Grid.Item>
6684 <Grid.Item as={Text}>Login</Grid.Item>
6785 </Grid.Item>
68− {isOther && <Grid.Item full as={Other} goHome={goHome} />}
69− {!isOther && <Grid.Item full as={Ticket} goHome={goHome} />}
86+ {flow && (
87+ <Grid.Item full as={Text} className="t-center mb4">
88+ {flowDescription(flow)}
89+ </Grid.Item>
90+ )}
91+ <Grid.Item full as={isOther ? Other : Ticket} goHome={goHome} />
7092 {!isOther && (
7193 <>
7294 <Grid.Item full className="t-center mv4 gray4">
@@ -80,10 +102,15 @@ export default function Login() {
80102 onClick={() => setisOther(true)}>
81103 Metamask, Mnemonic, Hardware Wallet...
82104 </Grid.Item>
83− <Grid.Item full onClick={goToActivate} className="mv10 t-center f6">
84− <span className="gray4">New Urbit ID? </span>
85− <LinkButton>Activate</LinkButton>
86− </Grid.Item>
105+ {!flow && (
106+ <Grid.Item
107+ full
108+ onClick={goToActivate}
109+ className="mv10 t-center f6">
110+ <span className="gray4">New Urbit ID? </span>
111+ <LinkButton>Activate</LinkButton>
112+ </Grid.Item>
113+ )}
87114 </>
88115 )}
89116 {isOther && (