Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/L2/Dropdowns/AccountsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const AccountsDropdown = ({ showMigrate = false }: AccountsDropdownProps) => {
point.value >= 0 ? point.patp : currentAddress.slice(0, 6);

const displayedPoints = useMemo(
() => pointList.filter(({ ownManageSpawn }) => ownManageSpawn),
() => pointList.filter(({ ownManageSpawnVote }) => ownManageSpawnVote),
[pointList]
);

Expand Down
8 changes: 4 additions & 4 deletions src/lib/types/Point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class Point {
showInvites: boolean;
isDefault: boolean;
isPlaceholder: boolean;
ownManageSpawn: boolean;
ownManageSpawnVote: boolean;
shouldDisplay: boolean;
isOutgoing: boolean;
permissionLevel: PermissionLevel;
Expand Down Expand Up @@ -206,11 +206,11 @@ export default class Point {
this.showInvites = this.canManage || this.canSpawn;
this.isDefault = value === -1;
this.isPlaceholder = isPlaceholder;
this.ownManageSpawn =
this.ownManageSpawnVote =
!this.isPlaceholder &&
!this.isDefault &&
(this.isOwner || this.isSpawnProxy || this.isManagementProxy);
this.shouldDisplay = this.ownManageSpawn || this.isTransferProxy;
(this.isOwner || this.isSpawnProxy || this.isManagementProxy || this.isVotingProxy);
this.shouldDisplay = this.ownManageSpawnVote || this.isTransferProxy;
this.isOutgoing =
this.isTransferProxySet &&
!this.isTransferProxy &&
Expand Down
9 changes: 8 additions & 1 deletion src/views/Ops/Ops.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
.id-ops {
.between-row {
.section-title, .subtitle {

.section-title,
.subtitle {
font-size: 14px;
}
}

.disabled {
opacity: 0.5;
pointer-events: none;
}
}
25 changes: 18 additions & 7 deletions src/views/Ops/Ops.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,39 +67,50 @@ export const Ops = () => {
</Row>
</HeaderPane>
<BodyPane>
<Row className="between-row management">
<Row className={"between-row management" +
(point.canManage ? "" : " disabled")}
>
<Box>
<Box className="section-title">Residents</Box>
<Box className="subtitle">
{isGalaxy(_point) ? 'Stars' : 'Planets'} that you route packets
for
</Box>
</Box>
<Button className="secondary" onClick={goResidents}>
<Button className="secondary"
onClick={point.canManage ? goResidents : undefined}
>
View
</Button>
</Row>
<Row className="between-row management">
<Row className={"between-row management" +
(point.canManage ? "" : " disabled")}
>
<Box>
<Box className="section-title">Requests</Box>
<Box className="subtitle">
{isGalaxy(_point) ? 'Stars' : 'Planets'} requesting your
sponsorship
</Box>
</Box>
<Button className="secondary" onClick={goRequests}>
<Button className="secondary"
onClick={point.canManage ? goRequests : undefined}
>
View
</Button>
</Row>
{point.isGalaxy && (
<Row className="between-row management">
<Box>
<Row className={"between-row management" +
(point.canVote ? "" : " disabled")}
>
<Box >
<Box className="section-title">Proposals</Box>
<Box className="subtitle">
View or vote on proposals in the Senate
</Box>
</Box>
<Button className="secondary" onClick={goSenate}>
<Button className="secondary"
onClick={point.canVote ? goSenate : undefined}>
View
</Button>
</Row>
Expand Down
11 changes: 5 additions & 6 deletions src/views/Point/Point.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function Point() {
loadL2Info();
}, [point]); // eslint-disable-line react-hooks/exhaustive-deps

const { isParent, canManage, isSpawnProxy } = point;
const { isParent, canManage, canVote, canSpawn } = point;

const goUrbitOS = useCallback(() => {
if (hideMessage) setSeenMissingKeys(hideMessage);
Expand Down Expand Up @@ -114,9 +114,8 @@ export default function Point() {
<PendingTransaction
layer={2}
nextRoll={nextRoll}
title={`${spawnedPending} Planet${
spawnedPending > 1 ? 's' : ''
} Spawned`}
title={`${spawnedPending} Planet${spawnedPending > 1 ? 's' : ''
} Spawned`}
/>
)}
{!!otherPending.length &&
Expand Down Expand Up @@ -163,14 +162,14 @@ export default function Point() {
/>
</Grid.Item>
)}
{(canManage || isSpawnProxy) && (
{(canManage || canSpawn || canVote) && (
<Grid.Item full as={Flex} justify="between">
<Card
title="ID"
subtitle="Master Key, Passport, Proxy Addresses, etc"
icon={(<Icon icon="User" />) as any}
onClick={goUrbitID}
disabled={!(canManage || isSpawnProxy)}
disabled={!(canManage || canSpawn || canVote)}
/>
</Grid.Item>
)}
Expand Down
19 changes: 9 additions & 10 deletions src/views/UrbitID/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default function UrbitIDHome() {
const goResetKeys = useCallback(() => push(names.RESET_KEYS), [push, names]);

const isMasterTicket = Just.hasInstance(urbitWallet);
const { isOwner, canManage } = point;
const networkRevision = convertToInt(point.keyRevisionNumber, 10);

const goSetProxy = useCallback(
Expand All @@ -75,20 +74,20 @@ export default function UrbitIDHome() {
<HeaderPane>
<Row className="header-row">
<h5>ID</h5>
{isMasterTicket && (
{isMasterTicket && point.isOwner && (
<Button onClick={downloadKeys} className="header-button">
{keysDownloaded
? 'Downloaded!'
: paper.matchWith({
Nothing: () => 'Printing and folding...',
Just: (_: any) => 'Download Passport',
})}
Nothing: () => 'Printing and folding...',
Just: (_: any) => 'Download Passport',
})}
</Button>
)}
</Row>
</HeaderPane>
<BodyPane>
{isOwner && (
{point.isOwner && (
<Row className="between-row owner">
<Box>
<Box>Ownership Address</Box>
Expand All @@ -105,7 +104,7 @@ export default function UrbitIDHome() {
</Row>
)}

{canManage && (
{point.canManage && (
<Row className="between-row management">
<Box>
<Box>Management Address</Box>
Expand All @@ -131,7 +130,7 @@ export default function UrbitIDHome() {
</Row>
)}

{point.isParent && (
{point.canSpawn && (
<Row className="between-row management">
<Box>
<Box>Spawn Proxy Address</Box>
Expand All @@ -156,7 +155,7 @@ export default function UrbitIDHome() {
</Row>
)}

{isOwner && (
{point.isOwner && (
<Row className="between-row management">
<WithTooltip content={MASTER_TICKET_TOOLTIP}>
<Box>
Expand Down Expand Up @@ -193,7 +192,7 @@ export default function UrbitIDHome() {
<Icon className="arrow-button" icon="ArrowEast" />
</Row>

{point.isGalaxy && (
{point.canVote && (
<Row className="between-row management">
<Box>
<Box>Edit Voting Key</Box>
Expand Down