1import Maybe from 'folktale/maybe';
2import React from 'react';
3import * as ob from 'urbit-ob';
5import { Button } from '../components/old/Base';
6import { Row, Col, H1, P } from '../components/old/Base';
7import { InnerLabel, PointInput, ValidatedSigil } from '../components/old/Base';
9import { ROUTE_NAMES } from '../lib/routeNames';
10import { withHistory } from '../store/history';
11import { compose } from '../lib/lib';
12import { withPointCursor } from '../store/pointCursor';
14class ViewPoint extends React.Component {
22 this.handlePointInput = this.handlePointInput.bind(this);
25 handlePointInput = pointName => {
26 if (pointName.length < 15) {
27 this.setState({ pointName });
32 const { pointName } = this.state;
33 const { history, setPointCursor } = this.props;
37 // could use a better patp parser in urbit-ob
40 valid = ob.isValidPatp(pointName);
48 <H1>{'View a Point'}</H1>
50 <P>{'Enter a point name to view its public information.'}</P>
55 prop-format="innerLabel"
57 placeholder="e.g. ~zod"
58 onChange={this.handlePointInput}
60 <InnerLabel>{'Point Name'}</InnerLabel>
62 className={'tr-0 mt-05 mr-0 abs'}
72 disabled={valid === false}
74 setPointCursor(Maybe.Just(parseInt(ob.patp2dec(pointName), 10)));
75 // ^ pointCursor expects native number type, not string
76 history.popAndPush(ROUTE_NAMES.SHIP);
86export default compose(
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