@@ -2,6 +2,7 @@ import React, { useState, useCallback } from 'react';
2import { Just, Nothing } from 'folktale/maybe';
2import { Just, Nothing } from 'folktale/maybe';
3import * as need from 'lib/need';
3import * as need from 'lib/need';
4import { Grid } from 'indigo-react';
4import { Grid } from 'indigo-react';
5+import { azimuth } from 'azimuth-js';
6import { ForwardButton } from 'components/Buttons';
7import { ForwardButton } from 'components/Buttons';
7import { matchBlinky, matchBlinkyDate } from 'components/Blinky';
8import { matchBlinky, matchBlinkyDate } from 'components/Blinky';
@@ -46,13 +47,13 @@ export default function AdminEditPermissions() {
46 const [rekeyDate, setRekeyDate] = useState(Nothing());
47 const [rekeyDate, setRekeyDate] = useState(Nothing());
48 const point = need.point(pointCursor);
49 const point = need.point(pointCursor);
50+ const pointSize = azimuth.getPointSize(point);
51+ const isParent = pointSize !== azimuth.PointSize.Planet;
52+ const isSenate = pointSize === azimuth.PointSize.Galaxy;
49 const userAddress = need.wallet(wallet).address;
53 const userAddress = need.wallet(wallet).address;
51 const details = need.details(getDetails(point));
55 const details = need.details(getDetails(point));
52− const { canManage, canSpawn, canVote } = usePermissionsForPoint(
56+ const { canManage, isOwner } = usePermissionsForPoint(userAddress, point);
57 useLifecycle(() => {
58 useLifecycle(() => {
58 getRekeyDate(need.web3(web3), need.contracts(contracts), point).then(
59 getRekeyDate(need.web3(web3), need.contracts(contracts), point).then(
@@ -82,14 +83,17 @@ export default function AdminEditPermissions() {
82 )} proxy.`;
83 )} proxy.`;
85− <Grid.Item full>
87+ <Grid.Item full>
86− <ForwardButton
88+ <ForwardButton
87− disabled={!enabled}
89+ disabled={!enabled}
88− onClick={() => goToProxy(proxyType)}
90+ onClick={() => goToProxy(proxyType)}
89− detail={detail}>
91+ detail={detail}>
90− {capitalize(proxyTypeToHuman(proxyType))} Proxy Address
92+ {capitalize(proxyTypeToHuman(proxyType))} Proxy Address
91− </ForwardButton>
93+ </ForwardButton>
92− </Grid.Item>
94+ </Grid.Item>
@@ -114,14 +118,11 @@ export default function AdminEditPermissions() {
114 </Grid.Item>
118 </Grid.Item>
115 <Grid.Divider />
119 <Grid.Divider />
117− {proxyAction(PROXY_TYPE.MANAGEMENT, details.managementProxy, canManage)}
121+ {proxyAction(PROXY_TYPE.MANAGEMENT, details.managementProxy, isOwner)}
120− {proxyAction(PROXY_TYPE.SPAWN, details.spawnProxy, canSpawn)}
123+ {isParent && proxyAction(PROXY_TYPE.SPAWN, details.spawnProxy, isOwner)}
123− {proxyAction(PROXY_TYPE.VOTING, details.votingProxy, canVote)}
125+ {isSenate && proxyAction(PROXY_TYPE.VOTING, details.votingProxy, isOwner)}
126 <Grid.Item
127 <Grid.Item