1import React, { useCallback } from 'react';
2import { Grid, Text, Flex } from 'indigo-react';
4import { versionLabel } from 'lib/flags';
6import { useHistory } from 'store/history';
8import { COMMANDS, FlowType, useFlowCommand } from 'lib/flowCommand';
10import View from 'components/View';
11import Footer from 'components/Footer';
13import Other from './Login/Other';
17export default function Login() {
19 const { push, names }: any = useHistory();
20 const flow: any = useFlowCommand();
22 const goHome = useCallback(() => {
27 case COMMANDS.TAKE_LOCKUP:
28 push(names.ACCEPT_LOCKUP);
31 case COMMANDS.BITCOIN:
40 throw new Error('unimplemented flow ' + flow.kind);
43 }, [flow, push, names]);
45 const flowDescription = (command: FlowType) => {
50 switch (command.kind) {
51 case COMMANDS.TAKE_LOCKUP:
52 //TODO kind of want "sign in as 0xabc.." here...
53 return <>To accept a star lockup batch, please sign in.</>;
55 case COMMANDS.BITCOIN:
56 return <>To sign a Bitcoin transaction, please sign in.</>;
59 return <>To view your Bitcoin extended public key, please sign in.</>;
62 return <>Flow: {command.kind}</>;
72 className="flex justify-center mt9 mb7 w-max-mobile">
73 <Grid.Item as={Text}>Bridge / </Grid.Item>
74 <Grid.Item className="fw-bold" as={Text}>
79 <Grid.Item full as={Text} className="t-center mb4">
80 {flowDescription(flow)}
87 className="login-selector w-max-mobile"
92 <Flex className="mb8 f6" justify="between">
95 href="https://github.com/urbit/bridge/releases"
96 className="us-none pointer">
97 <span className="underline">Offline</span> ↗
99 <Flex.Item className="gray4">v{versionLabel}</Flex.Item>
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