on master help sign in
ops-view: new route, root component, and styles
29574a9tomholford
src/components/L2/Card.scss+4
@@ -12,6 +12,10 @@
12 font-weight: bold;
12 font-weight: bold;
13 }
13 }
14
14
15+ .card-subtitle {
16+ color: rgba(0, 0, 0, 0.6);
17+ }
18+
15 svg {
19 svg {
16 width: 16px;
20 width: 16px;
17 height: 16px;
21 height: 16px;
src/components/L2/Window/HeaderPane.scss+4
@@ -36,6 +36,10 @@
36 &:hover {
36 &:hover {
37 opacity: 0.8;
37 opacity: 0.8;
38 }
38 }
39+
40+ svg > path {
41+ fill: white;
42+ }
39 }
43 }
40 }
44 }
41}
45}
src/lib/routeNames.js+1
@@ -35,4 +35,5 @@ export const ROUTE_NAMES = {
35 BITCOIN_SIGN_TRANSACTION: Symbol('BITCOIN_SIGN_TRANSACTION'),
35 BITCOIN_SIGN_TRANSACTION: Symbol('BITCOIN_SIGN_TRANSACTION'),
36 TRANSACTION_HISTORY: Symbol('TRANSACTION_HISTORY'),
36 TRANSACTION_HISTORY: Symbol('TRANSACTION_HISTORY'),
37 MIGRATE_L2: Symbol('MIGRATE_L2'),
37 MIGRATE_L2: Symbol('MIGRATE_L2'),
38+ OPS: Symbol('OPS'),
38};
39};
src/lib/router.js+2
@@ -29,6 +29,7 @@ import SignTransaction from 'views/Bitcoin/SignTransaction';
29import TransactionHistory from 'views/Transactions/TransactionHistory';
29import TransactionHistory from 'views/Transactions/TransactionHistory';
30
30
31import { ROUTE_NAMES } from './routeNames';
31import { ROUTE_NAMES } from './routeNames';
32+import { Ops } from 'views/Ops/Ops';
32
33
33export const ROUTES = {
34export const ROUTES = {
34 [ROUTE_NAMES.DISCLAIMER]: Disclaimer,
35 [ROUTE_NAMES.DISCLAIMER]: Disclaimer,
@@ -59,4 +60,5 @@ export const ROUTES = {
59 [ROUTE_NAMES.BITCOIN_SIGN_TRANSACTION]: SignTransaction,
60 [ROUTE_NAMES.BITCOIN_SIGN_TRANSACTION]: SignTransaction,
60 [ROUTE_NAMES.TRANSACTION_HISTORY]: TransactionHistory,
61 [ROUTE_NAMES.TRANSACTION_HISTORY]: TransactionHistory,
61 [ROUTE_NAMES.MIGRATE_L2]: MigrateL2,
62 [ROUTE_NAMES.MIGRATE_L2]: MigrateL2,
63+ [ROUTE_NAMES.OPS]: Ops,
62};
64};
src/views/Ops/Ops.tsxnew file+82
@@ -0,0 +1,82 @@
1+import * as need from 'lib/need';
2+import { Box, Row, Button, Icon } from '@tlon/indigo-react';
3+
4+import Window from 'components/L2/Window/Window';
5+import HeaderPane from 'components/L2/Window/HeaderPane';
6+import BodyPane from 'components/L2/Window/BodyPane';
7+import { useCallback } from 'react';
8+import { useLocalRouter } from 'lib/LocalRouter';
9+import { isGalaxy } from 'lib/utils/point';
10+import { usePointCursor } from 'store/pointCursor';
11+import View from 'components/View';
12+import L2BackHeader from 'components/L2/Headers/L2BackHeader';
13+
14+export const Ops = () => {
15+ const { pop, push, names }: any = useLocalRouter();
16+ const { pointCursor }: any = usePointCursor();
17+ const point = need.point(pointCursor);
18+
19+ const goSenate = useCallback(() => push(names.SENATE), [push, names]);
20+ const goResidents = useCallback(() => push(names.RESIDENTS), [push, names]);
21+ const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
22+ names.ISSUE_CHILD,
23+ push,
24+ ]);
25+
26+ return (
27+ <View
28+ id="ops"
29+ pop={pop}
30+ inset
31+ hideBack
32+ className="urbit-id"
33+ header={<L2BackHeader hideBalance back={pop} />}>
34+ <Window className="id-ops">
35+ <HeaderPane>
36+ <Row className="header-row">
37+ <h5>{isGalaxy(point) ? 'Galaxy' : 'Star'} Ops</h5>
38+ <Button onClick={goIssuePoint} className="header-button">
39+ <Icon icon="Node" /> &nbsp;Spawn&nbsp;
40+ {isGalaxy(point) ? 'Stars' : 'Planets'}
41+ </Button>
42+ </Row>
43+ </HeaderPane>
44+ <BodyPane>
45+ <Row className="between-row management">
46+ <Box>
47+ <Box>Residents</Box>
48+ <Box className="subtitle">Planets that you route packets for</Box>
49+ </Box>
50+ <Button className="secondary" onClick={goResidents}>
51+ View
52+ </Button>
53+ </Row>
54+ <Row className="between-row management">
55+ <Box>
56+ <Box>Requests</Box>
57+ <Box className="subtitle">
58+ Planets requesting your sponsorship
59+ </Box>
60+ </Box>
61+ <Button className="secondary" onClick={goResidents}>
62+ View
63+ </Button>
64+ </Row>
65+ {isGalaxy(point) && (
66+ <Row className="between-row management">
67+ <Box>
68+ <Box>Proposals</Box>
69+ <Box className="subtitle">
70+ View or vote on proposals in the Senate
71+ </Box>
72+ </Box>
73+ <Button className="secondary" onClick={goSenate}>
74+ View
75+ </Button>
76+ </Row>
77+ )}
78+ </BodyPane>
79+ </Window>
80+ </View>
81+ );
82+};
src/views/Point/Point.tsx+8−5
@@ -141,6 +141,8 @@ export default function Point() {
141
141
142 const goResidents = useCallback(() => push(names.RESIDENTS), [push, names]);
142 const goResidents = useCallback(() => push(names.RESIDENTS), [push, names]);
143
143
144+ const goOps = useCallback(() => push(names.OPS), [push, names]);
145+
144 const planet = isPlanet(point);
146 const planet = isPlanet(point);
145
147
146 const [showInviteForm, setShowInviteForm] = useState(false);
148 const [showInviteForm, setShowInviteForm] = useState(false);
@@ -221,13 +223,14 @@ export default function Point() {
221 {isParent && (
223 {isParent && (
222 <Grid.Item full as={Flex} justify="between">
224 <Grid.Item full as={Flex} justify="between">
223 <Card
225 <Card
226+ icon={(<Icon icon="BootNode" />) as any}
224 title={`${isStar(point) ? 'Star' : 'Galaxy'} Ops`}
227 title={`${isStar(point) ? 'Star' : 'Galaxy'} Ops`}
225 subtitle={
228 subtitle={
226 isStar(point)
229 isStar(point)
227− ? 'Manage planets you sponsor and spawn planets'
230+ ? 'Residents, Requests, Spawn Planets'
228− : 'Manage stars you sponsor, spawn stars, and vote'
231+ : 'Residents, Requests, Spawn Stars, Vote'
229 }
232 }
230− onClick={goResidents}
233+ onClick={goOps}
231 />
234 />
232 </Grid.Item>
235 </Grid.Item>
233 )}
236 )}
@@ -253,7 +256,7 @@ export default function Point() {
253 <Grid.Item full as={Flex} justify="between">
256 <Grid.Item full as={Flex} justify="between">
254 <Card
257 <Card
255 title="ID"
258 title="ID"
256− subtitle="Identity and security settings"
259+ subtitle="Master Key, Passport, Proxy Addresses, etc"
257 icon={(<Icon icon="User" />) as any}
260 icon={(<Icon icon="User" />) as any}
258 onClick={goUrbitID}
261 onClick={goUrbitID}
259 disabled={!canManage}
262 disabled={!canManage}
@@ -262,7 +265,7 @@ export default function Point() {
262 <Grid.Item full as={Flex} justify="between">
265 <Grid.Item full as={Flex} justify="between">
263 <Card
266 <Card
264 title="OS"
267 title="OS"
265− subtitle="Urbit OS Settings"
268+ subtitle="Sponsor, Network Keys, Access Key"
266 icon={(<Icon icon="Server" />) as any}
269 icon={(<Icon icon="Server" />) as any}
267 onClick={goUrbitOS}
270 onClick={goUrbitOS}
268 disabled={!canManage}
271 disabled={!canManage}