1import React, { useCallback } from 'react';
2import { Grid } from 'indigo-react';
3import cn from 'classnames';
4import * as ob from 'urbit-ob';
6import Sigil from 'components/Sigil';
8import { usePointCache } from 'store/pointCache';
9import { useWallet } from 'store/wallet';
11import * as need from 'lib/need';
12import usePermissionsForPoint from 'lib/usePermissionsForPoint';
13import { useSyncOwnedPoints } from 'lib/useSyncPoints';
14import { buildKeyType } from 'lib/point';
16function ActiveViewRow({ point, goPoint }) {
17 const { wallet } = useWallet();
18 const address = need.addressFromWallet(wallet);
19 useSyncOwnedPoints([point]);
20 const permissions = usePermissionsForPoint(address, point);
22 const keyType = buildKeyType(permissions);
23 const patp = ob.patp(point);
26 const onClick = useCallback(() => goPoint(point), [point, goPoint]);
29 <Grid.Item className="flex-row align-center" cols={[1, 3]}>
32 <Grid.Item className="flex-row align-center" cols={[3, 6]}>
35 display: 'inline-block',
36 height: `${sigilSize}px`,
37 width: `${sigilSize}px`,
39 <Sigil patp={patp} size={25} colors={['#FFFFFF', '#000000']} />
42 <Grid.Item className="flex-row align-center" cols={[6, 10]}>
48 className="flex-row-r align-center mr2">
56export default function ActiveView({ className, goPoint }) {
57 // const points = [2560, 2561, 2562];
58 const { controlledPoints } = usePointCache();
59 console.log(controlledPoints);
60 const points = controlledPoints
69 ...value.votingPoints,
70 ...value.managingPoints,
71 ...value.spawningPoints,
77 .filter(p => 255 < p && p < 65536);
80 <Grid full className={cn('f5', className)}>
81 <Grid.Item className="pv3 " cols={[1, 6]} third={1}>
84 <Grid.Item className="pv3 " cols={[6, 10]}>
88 {points.length === 0 && (
89 <Grid.Item full className="flex-center pv8 f5 gray4">
90 You have no active stars
93 {points.map(point => (
97 point={point}></ActiveViewRow>
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