1import React, { useCallback, useState } from 'react';
2import { P, H4, H5, Grid, Text, Button, Flex, LinkButton } from 'indigo-react';
4import { version } from '../../package.json';
6import { useHistory } from 'store/history';
7import { useWallet } from 'store/wallet';
9import { WALLET_TYPES } from 'lib/wallet';
11import View from 'components/View';
12import Tabs from 'components/Tabs';
13import Crumbs from 'components/Crumbs';
14import Footer from 'components/Footer';
15import { ForwardButton, OfflineButton } from 'components/Buttons';
17import Ticket from './Login/Ticket';
18import Other from './Login/Other';
26 [NAMES.TICKET]: Ticket,
31 { text: 'Master Ticket', value: NAMES.TICKET },
32 { text: 'Other', value: NAMES.OTHER },
35const walletTypeToViewName = walletType => {
36 if (walletType === WALLET_TYPES.TICKET || !walletType) {
42export default function Login() {
44 const { pop, push, names } = useHistory();
45 const { walletType } = useWallet();
48 const [isOther, setisOther] = useState(false);
50 const goToActivate = useCallback(() => push(names.ACTIVATE), [
55 const goHome = useCallback(() => {
62 <Grid.Item full as={Text} className="flex justify-center mt9 mb7">
63 <Grid.Item as={Text} className="gray3">
66 <Grid.Item as={Text}>Login</Grid.Item>
68 {isOther && <Grid.Item full as={Other} goHome={goHome} />}
69 {!isOther && <Grid.Item full as={Ticket} goHome={goHome} />}
72 <Grid.Item full className="t-center mv4 gray4">
78 className="b-solid b1 b-black"
80 onClick={() => setisOther(true)}>
81 Metamask, Mnemonic, Hardware Wallet...
83 <Grid.Item full onClick={goToActivate} className="mv10 t-center f6">
84 <span className="gray4">New Urbit ID? </span>
85 <LinkButton>Activate</LinkButton>
92 onClick={() => setisOther(false)}
94 className="t-center underline f6 mt8">
101 <Flex className="mb8 f6" justify="between">
104 href="https://github.com/urbit/bridge/releases"
105 className="us-none pointer">
106 <span className="underline">Offline</span> ↗
108 <Flex.Item className="gray4">v{version}</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