1import { useCallback } from 'react';
2import * as need from 'lib/need';
3import { Box, Row, Button, Icon } from '@tlon/indigo-react';
5import { useRollerStore } from 'store/rollerStore';
6import { usePointCursor } from 'store/pointCursor';
8import { useLocalRouter } from 'lib/LocalRouter';
9import { isGalaxy } from 'lib/utils/point';
11import Window from 'components/L2/Window/Window';
12import HeaderPane from 'components/L2/Window/HeaderPane';
13import BodyPane from 'components/L2/Window/BodyPane';
14import View from 'components/View';
15import L2BackHeader from 'components/L2/Headers/L2BackHeader';
19export const Ops = () => {
20 const { pop, push, popAndPush, names }: any = useLocalRouter();
21 const { pointCursor }: any = usePointCursor();
22 const { point } = useRollerStore();
23 const _point = need.point(pointCursor);
25 const goSenate = useCallback(() => push(names.SENATE), [push, names]);
26 const goResidents = useCallback(() => push(names.RESIDENTS), [push, names]);
27 const goRequests = useCallback(() => push(names.REQUESTS), [push, names]);
28 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
32 const goUrbitOS = useCallback(() => popAndPush(names.URBIT_OS), [
37 const getButtonContent = () => {
38 if (!point.couldSpawn) {
40 } else if (point.networkKeysSet) {
42 <Button onClick={goIssuePoint} className="header-button">
43 <Icon icon="Node" /> Spawn
44 {isGalaxy(_point) ? 'Stars' : 'Planets'}
49 <Button onClick={goUrbitOS} className="header-button">
61 header={<L2BackHeader hideBalance back={pop} />}>
62 <Window className="id-ops">
64 <Row className="header-row">
65 <h5>{isGalaxy(_point) ? 'Galaxy' : 'Star'} Ops</h5>
72 'between-row management' + (point.canManage ? '' : ' disabled')
75 <Box className="section-title">Residents</Box>
76 <Box className="subtitle">
77 {isGalaxy(_point) ? 'Stars' : 'Planets'} that you route packets
83 onClick={point.canManage ? goResidents : undefined}>
89 'between-row management' + (point.canManage ? '' : ' disabled')
92 <Box className="section-title">Requests</Box>
93 <Box className="subtitle">
94 {isGalaxy(_point) ? 'Stars' : 'Planets'} requesting your
100 onClick={point.canManage ? goRequests : undefined}>
107 'between-row management' + (point.canVote ? '' : ' disabled')
110 <Box className="section-title">Proposals</Box>
111 <Box className="subtitle">
112 View or vote on proposals in the Senate
116 className="secondary"
117 onClick={point.canVote ? goSenate : undefined}>
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