on master help sign in
Remove the landing page
a15dd23Fang
src/Bridge.js+6−3
@@ -13,6 +13,7 @@ import { NETWORK_TYPES } from 'lib/network';
13import { walletFromMnemonic } from 'lib/wallet';
13import { walletFromMnemonic } from 'lib/wallet';
14import { isDevelopment } from 'lib/flags';
14import { isDevelopment } from 'lib/flags';
15import { hasDisclaimed } from 'lib/disclaimerCookie';
15import { hasDisclaimed } from 'lib/disclaimerCookie';
16+import useImpliedTicket from 'lib/useImpliedTicket';
16
17
17import 'style/index.scss';
18import 'style/index.scss';
18
19
@@ -23,16 +24,18 @@ const INITIAL_NETWORK_TYPE = isDevelopment
23// NB(shrugs): modify these variables to change the default local state.
24// NB(shrugs): modify these variables to change the default local state.
24const SHOULD_STUB_LOCAL = process.env.REACT_APP_STUB_LOCAL === 'true';
25const SHOULD_STUB_LOCAL = process.env.REACT_APP_STUB_LOCAL === 'true';
25const IS_STUBBED = isDevelopment && SHOULD_STUB_LOCAL;
26const IS_STUBBED = isDevelopment && SHOULD_STUB_LOCAL;
27+const LANDING_PAGE = !!useImpliedTicket()
28+ ? ROUTE_NAMES.ACTIVATE
29+ : ROUTE_NAMES.LOGIN;
26const INITIAL_ROUTES = IS_STUBBED
30const INITIAL_ROUTES = IS_STUBBED
27 ? [
31 ? [
28− { key: ROUTE_NAMES.LANDING },
29 { key: ROUTE_NAMES.LOGIN },
32 { key: ROUTE_NAMES.LOGIN },
30 { key: ROUTE_NAMES.POINTS },
33 { key: ROUTE_NAMES.POINTS },
31 { key: ROUTE_NAMES.POINT },
34 { key: ROUTE_NAMES.POINT },
32 ]
35 ]
33 : hasDisclaimed()
36 : hasDisclaimed()
34− ? [{ key: ROUTE_NAMES.LANDING }]
37+ ? [{ key: LANDING_PAGE }]
35− : [{ key: ROUTE_NAMES.DISCLAIMER }];
38+ : [{ key: LANDING_PAGE }, { key: ROUTE_NAMES.DISCLAIMER }];
36
39
37const INITIAL_WALLET = IS_STUBBED
40const INITIAL_WALLET = IS_STUBBED
38 ? walletFromMnemonic(
41 ? walletFromMnemonic(
src/lib/router.js−2
@@ -1,4 +1,3 @@
1−import Landing from 'views/Landing';
2import Disclaimer from 'views/Disclaimer';
1import Disclaimer from 'views/Disclaimer';
3import Login from 'views/Login.js';
2import Login from 'views/Login.js';
4import Admin from 'views/Admin';
3import Admin from 'views/Admin';
@@ -16,7 +15,6 @@ import PartySetPoolSize from 'views/Party/PartySetPoolSize';
16import { ROUTE_NAMES } from './routeNames';
15import { ROUTE_NAMES } from './routeNames';
17
16
18export const ROUTES = {
17export const ROUTES = {
19− [ROUTE_NAMES.LANDING]: Landing,
20 [ROUTE_NAMES.DISCLAIMER]: Disclaimer,
18 [ROUTE_NAMES.DISCLAIMER]: Disclaimer,
21 [ROUTE_NAMES.ACTIVATE]: Activate,
19 [ROUTE_NAMES.ACTIVATE]: Activate,
22 [ROUTE_NAMES.VIEW_POINT]: ViewPoint,
20 [ROUTE_NAMES.VIEW_POINT]: ViewPoint,
src/views/Disclaimer.js+3−3
@@ -13,7 +13,7 @@ import WarningBox from 'components/WarningBox';
13const TEXT_STYLE = 'f5';
13const TEXT_STYLE = 'f5';
14
14
15export default function ActivateDisclaimer() {
15export default function ActivateDisclaimer() {
16− const { popAndPush, names } = useHistory();
16+ const { pop } = useHistory();
17 const [understoodInput, { data: isUnderstood }] = useCheckboxInput({
17 const [understoodInput, { data: isUnderstood }] = useCheckboxInput({
18 name: 'checkbox',
18 name: 'checkbox',
19 label: 'I acknowledge and understand these rights',
19 label: 'I acknowledge and understand these rights',
@@ -21,8 +21,8 @@ export default function ActivateDisclaimer() {
21
21
22 const goToPassport = useCallback(() => {
22 const goToPassport = useCallback(() => {
23 setDisclaimerCookie();
23 setDisclaimerCookie();
24− popAndPush(names.LANDING);
24+ pop();
25− }, [popAndPush, names]);
25+ }, [pop]);
26
26
27 return (
27 return (
28 <View>
28 <View>
src/views/Landing.jsdeleted−55
@@ -1,55 +0,0 @@
1−import React from 'react';
2−import { H1, P } from 'indigo-react';
3−
4−import { useHistory } from '../store/history';
5−import useImpliedPoint from 'lib/useImpliedPoint';
6−import useImpliedTicket from 'lib/useImpliedTicket';
7−
8−import View from 'components/View';
9−import { ForwardButton } from 'components/Buttons';
10−
11−function Landing() {
12− const { push, names } = useHistory();
13−
14− const impliedPoint = useImpliedPoint();
15− const impliedTicket = useImpliedTicket();
16− if (impliedPoint) {
17− push(names.LOGIN);
18− } else if (impliedTicket) {
19− push(names.ACTIVATE);
20− }
21−
22− return (
23− <View>
24− <H1>Welcome</H1>
25−
26− <P>
27− Bridge is a tool for managing and viewing assets on Azimuth, the Urbit
28− address space.
29− </P>
30−
31− <ForwardButton
32− className="mt3"
33− detail="If you were sent an Azimuth invite code."
34− onClick={() => push(names.ACTIVATE)}>
35− Activate a Point
36− </ForwardButton>
37−
38− <ForwardButton
39− className="mt3"
40− detail="Login to an activated point."
41− onClick={() => push(names.LOGIN)}>
42− Login
43− </ForwardButton>
44−
45− <ForwardButton
46− className="mt3"
47− detail="View an Azimuth point without signing into a wallet."
48− onClick={() => push(names.VIEW_POINT)}>
49− View a Point
50− </ForwardButton>
51− </View>
52− );
53−}
54−
55−export default Landing;