1import React, { useCallback, useState } from 'react';
2import Maybe from 'folktale/maybe';
3import * as ob from 'urbit-ob';
4import { Input } from 'indigo-react';
6import { H1, P } from '../components/old/Base';
8import { useHistory } from 'store/history';
9import { usePointCursor } from 'store/pointCursor';
11import { ROUTE_NAMES } from 'lib/routeNames';
13import View from 'components/View';
14import { ForwardButton } from 'components/Buttons';
15import { usePointInput } from 'components/Inputs';
17export default function ViewPoint() {
18 const history = useHistory();
19 const { setPointCursor } = usePointCursor();
20 const pointInput = usePointInput({
25 const { data: pointName, pass } = pointInput;
27 const disabled = !pass;
28 const goForward = useCallback(() => {
29 setPointCursor(Maybe.Just(parseInt(ob.patp2dec(pointName), 10)));
30 // ^ pointCursor expects native number type, not string
31 history.popAndPush(ROUTE_NAMES.POINT);
32 }, [setPointCursor, history, pointName]);
38 <P>Enter a point name to view its public information.</P>
40 <Input {...pointInput} onEnter={goForward} />
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