landscape: hide 'promote to admin' on pending patp

Fixes urbit/landscape#694
This commit is contained in:
Matilde Park 2021-04-13 15:42:53 -04:00
parent 421dc97a64
commit 103547ba3b

View File

@ -295,7 +295,7 @@ function Participant(props: {
const resource = resourceFromPath(association.group); const resource = resourceFromPath(association.group);
if(contact.pending) { if(contact.pending) {
await api.groups.changePolicy( await api.groups.changePolicy(
resource, resource,
{ invite: { removeInvites: [`~${contact.patp}`] } } { invite: { removeInvites: [`~${contact.patp}`] } }
); );
} else { } else {
@ -305,12 +305,12 @@ function Participant(props: {
const avatar = const avatar =
contact?.avatar !== null && !hideAvatars ? ( contact?.avatar !== null && !hideAvatars ? (
<Image <Image
src={contact.avatar} src={contact.avatar}
height={32} height={32}
width={32} width={32}
display='inline-block' display='inline-block'
style={{ objectFit: 'cover' }} style={{ objectFit: 'cover' }}
/> />
) : ( ) : (
<Sigil ship={contact.patp} size={32} color={`#${color}`} /> <Sigil ship={contact.patp} size={32} color={`#${color}`} />
@ -386,9 +386,9 @@ function Participant(props: {
{(contact.patp !== window.ship) && (<StatelessAsyncAction onClick={onKick} bg="transparent"> {(contact.patp !== window.ship) && (<StatelessAsyncAction onClick={onKick} bg="transparent">
<Text color="red">Kick from {title}</Text> <Text color="red">Kick from {title}</Text>
</StatelessAsyncAction>)} </StatelessAsyncAction>)}
<StatelessAsyncAction onClick={onPromote} bg="transparent"> {!contact.pending && <StatelessAsyncAction onClick={onPromote} bg="transparent">
Promote to Admin Promote to Admin
</StatelessAsyncAction> </StatelessAsyncAction>}
</> </>
)} )}
</> </>