on master help sign in
Remove ViewPoint view
1464137Fang
src/lib/routeNames.js−1
@@ -15,7 +15,6 @@ export const ROUTE_NAMES = {
15 //
15 //
16 ACCEPT_TRANSFER: Symbol('ACCEPT_TRANSFER'),
16 ACCEPT_TRANSFER: Symbol('ACCEPT_TRANSFER'),
17 CANCEL_TRANSFER: Symbol('CANCEL_TRANSFER'),
17 CANCEL_TRANSFER: Symbol('CANCEL_TRANSFER'),
18− VIEW_POINT: Symbol('VIEW_POINT'),
19 POINTS: Symbol('POINTS'),
18 POINTS: Symbol('POINTS'),
20 POINT: Symbol('POINT'),
19 POINT: Symbol('POINT'),
21 CREATE_GALAXY: Symbol('CREATE_GALAXY'),
20 CREATE_GALAXY: Symbol('CREATE_GALAXY'),
src/lib/router.js−2
@@ -3,7 +3,6 @@ import Login from 'views/Login.js';
3import Admin from 'views/Admin';
3import Admin from 'views/Admin';
4import CreateGalaxy from 'views/CreateGalaxy';
4import CreateGalaxy from 'views/CreateGalaxy';
5import IssueChild from 'views/IssueChild';
5import IssueChild from 'views/IssueChild';
6−import ViewPoint from 'views/ViewPoint';
7
6
8import Point from 'views/Point';
7import Point from 'views/Point';
9import Points from 'views/Points';
8import Points from 'views/Points';
@@ -19,7 +18,6 @@ import { ROUTE_NAMES } from './routeNames';
19export const ROUTES = {
18export const ROUTES = {
20 [ROUTE_NAMES.DISCLAIMER]: Disclaimer,
19 [ROUTE_NAMES.DISCLAIMER]: Disclaimer,
21 [ROUTE_NAMES.ACTIVATE]: Activate,
20 [ROUTE_NAMES.ACTIVATE]: Activate,
22− [ROUTE_NAMES.VIEW_POINT]: ViewPoint,
23 [ROUTE_NAMES.LOGIN]: Login,
21 [ROUTE_NAMES.LOGIN]: Login,
24 [ROUTE_NAMES.POINTS]: Points,
22 [ROUTE_NAMES.POINTS]: Points,
25 [ROUTE_NAMES.POINT]: Point,
23 [ROUTE_NAMES.POINT]: Point,
src/views/ViewPoint.jsdeleted−54
@@ -1,54 +0,0 @@
1−import React, { useCallback } from 'react';
2−import { Just } from 'folktale/maybe';
3−import { Input, Grid, Text } from 'indigo-react';
4−
5−import { useHistory } from 'store/history';
6−import { usePointCursor } from 'store/pointCursor';
7−
8−import patp2dec from 'lib/patp2dec';
9−import { usePointInput } from 'lib/useInputs';
10−
11−import View from 'components/View';
12−import { ForwardButton } from 'components/Buttons';
13−import ViewHeader from 'components/ViewHeader';
14−
15−export default function ViewPoint() {
16− const { pop, popAndPush, names } = useHistory();
17− const { setPointCursor } = usePointCursor();
18− const [pointInput, { data: pointName, pass }] = usePointInput({
19− name: 'point',
20− autoFocus: true,
21− });
22−
23− const disabled = !pass;
24− const goForward = useCallback(() => {
25− setPointCursor(Just(patp2dec(pointName)));
26− popAndPush(names.POINT);
27− }, [setPointCursor, pointName, popAndPush, names.POINT]);
28−
29− return (
30− <View pop={pop} inset>
31− <Grid>
32− <Grid.Item full as={ViewHeader}>
33− View a Point
34− </Grid.Item>
35−
36− <Grid.Item full as={Text}>
37− Enter a point name to view its public information.
38− </Grid.Item>
39−
40− <Grid.Item full as={Input} {...pointInput} onEnter={goForward} />
41−
42− <Grid.Item
43− full
44− as={ForwardButton}
45− className="mt3"
46− disabled={disabled}
47− onClick={goForward}
48− solid>
49− Continue
50− </Grid.Item>
51− </Grid>
52− </View>
53− );
54−}