@@ -0,0 +1,134 @@
1+import React from 'react';
2+import { Grid, Button, SelectInput } from 'indigo-react';
3+import * as ob from 'urbit-ob';
5+import { usePointCursor } from 'store/pointCursor';
6+import { usePointCache } from 'store/pointCache';
8+import useCurrentPointName from 'lib/useCurrentPointName';
9+import * as need from 'lib/need';
11+import { OutButton, ForwardButton } from 'components/Buttons';
12+import ViewHeader from 'components/ViewHeader';
14+import BridgeForm from 'form/BridgeForm';
16+export default function UrbitOSHome() {
17+ const { pointCursor } = usePointCursor();
18+ const { getDetails } = usePointCache();
20+ const point = need.point(pointCursor);
21+ const details = need.details(getDetails(point));
23+ const sponsor = ob.patp(details.sponsor);
28+ <Grid.Item full className="mv7 f5">
35+ detail="A sponsor finds new peers in your network"
36+ accessory={<u>Change</u>}>
37+ <span className="mono">{sponsor}</span>
38+ <span className="f7 bg-black white p1 ml2 r4">SPONSOR</span>
41+ <Grid.Item full as={ForwardButton}>
42+ Reset Networking Keys
45+ <Grid.Item full as={ForwardButton}>
49+ <Grid.Item full as={ForwardButton}>
58+ const name = useCurrentPointName();
59+ const options = [{ text: 'Tlon', value: 'tlon' }];
61+ const props = { name, options };
62+ const connected = false;
66+ <Grid.Item full className="f5">
70+ {(connected && <HostingConnected {...props} />) || (
71+ <HostingDisconnected {...props} />
77+function HostingConnected({ name, options }) {
79+ <BridgeForm initialValues={{ provider: 'tlon' }}>
82+ <Grid.Item full>Status: Connected</Grid.Item>
83+ <Grid.Item cols={[1, 9]} className="gray4">
84+ <span className="mono">{name}</span> is connected to Tlon and has
85+ the IP address 127.0.0.1
87+ <Grid.Item cols={[1, 9]} as={OutButton} solid success>
90+ <Grid.Item cols={[9, 13]} as={Button} className="b-black b1" center>
97+ label="Host Provider"
107+function HostingDisconnected({ options }) {
109+ <BridgeForm initialValues={{ provider: 'tlon' }}>
112+ <Grid.Item full className="gray4">
113+ <span className="gray3">Status:</span> Disconnected
115+ <span className="f6">Last connected: 4m ago</span>
118+ <Grid.Item full as={ForwardButton} solid>
126+ label="Host Provider"