Skip to content

Commit

Permalink
Show "Update metadata" button for instance without metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Oct 28, 2024
1 parent 6949b80 commit 02a341d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions ui/shared/AccountActionsMenu/AccountActionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ const AccountActionsMenu = ({ isLoading, className, showUpdateMetadataItem }: Pr
mixpanel.logEvent(mixpanel.EventTypes.PAGE_WIDGET, { Type: 'Address actions (more button)' });
}, []);

if (!config.features.account.isEnabled) {
return null;
}

const userWithoutEmail = profileQuery.data && !profileQuery.data.email;

const items = [
Expand All @@ -49,15 +45,15 @@ const AccountActionsMenu = ({ isLoading, className, showUpdateMetadataItem }: Pr
},
{
render: (props: ItemProps) => <TokenInfoMenuItem { ...props }/>,
enabled: isTokenPage && config.features.addressVerification.isEnabled && !userWithoutEmail,
enabled: config.features.account.isEnabled && isTokenPage && config.features.addressVerification.isEnabled && !userWithoutEmail,
},
{
render: (props: ItemProps) => <PrivateTagMenuItem { ...props } entityType={ isTxPage ? 'tx' : 'address' }/>,
enabled: true,
enabled: config.features.account.isEnabled,
},
{
render: (props: ItemProps) => <PublicTagMenuItem { ...props }/>,
enabled: !isTxPage && config.features.publicTagsSubmission.isEnabled,
enabled: config.features.account.isEnabled && !isTxPage && config.features.publicTagsSubmission.isEnabled,
},
].filter(({ enabled }) => enabled);

Expand Down
2 changes: 1 addition & 1 deletion ui/shared/AccountActionsMenu/parts/ButtonItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props {

const ButtonItem = ({ className, label, onClick, icon, isDisabled }: Props) => {
return (
<Tooltip label={ label }>
<Tooltip label={ label } isDisabled={ isDisabled }>
<IconButton
aria-label={ label }
className={ className }
Expand Down
2 changes: 1 addition & 1 deletion ui/tokenInstance/TokenInstancePageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const TokenInstancePageTitle = ({ isLoading, token, instance, hash }: Props) =>
) }
{ !isLoading && <AddressAddToWallet token={ token } variant="button"/> }
<AddressQrCode address={ address } isLoading={ isLoading }/>
<AccountActionsMenu isLoading={ isLoading } showUpdateMetadataItem={ Boolean(instance?.metadata) }/>
<AccountActionsMenu isLoading={ isLoading } showUpdateMetadataItem/>
{ appLink }
</Flex>
);
Expand Down

0 comments on commit 02a341d

Please sign in to comment.