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';
16import InputSigil from 'components/InputSigil';
18export default function ViewPoint() {
19 const history = useHistory();
20 const { setPointCursor } = usePointCursor();
21 const [lastValidPoint, setLastValidPoint] = useState('');
22 const pointInput = usePointInput({
26 onValue: setLastValidPoint,
28 const { data: pointName, pass, error, focused } = pointInput;
30 const disabled = !pass;
31 const goForward = useCallback(() => {
32 setPointCursor(Maybe.Just(parseInt(ob.patp2dec(pointName), 10)));
33 // ^ pointCursor expects native number type, not string
34 history.popAndPush(ROUTE_NAMES.POINT);
35 }, [setPointCursor, history, pointName]);
41 <P>Enter a point name to view its public information.</P>
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