Commit 2c35fb18 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Show "Update metadata" button for instance without metadata (#2327)

* simple profile button and auth modal layout

* connect email and code screens to API

* add screens to modal for wallet authentication

* migrate to pin input

* user profile menu

* refactor otp field

* fix passing set-cookie from api response

* add wallet info into profile menu

* add mobile menu

* show connected wallet address in button

* my profile page re-design

* custom behaviour of connect button on dapp page

* style pin input

* add logout

* handle case when account is disabled

* handle case when wc is disabled

* remove old components

* refactoring

* workflow to link wallet or email to account

* link wallet from profile

* show better OTP code errors

* add email alert on watchlist and verified addresses pages

* deprecate env and remove old code

* remove code for unverified email page

* add auth guard to address action items

* move useRedirectForInvalidAuthToken hook

* add mixpanel events

* refetch csrf token after login and fix connect wallet from contract page

* Add NEXT_PUBLIC_RE_CAPTCHA_V3_APP_SITE_KEY env

* migrate to reCAPTCHA v3

* resend code and change email from profile page

* better wallet sign-in message error

* fix demo envs

* update some screenshots

* profile button design fixes

* fix behaviour "connect wallet" button on contract page

* fix linking email and wallet to existing account

* bug fixes

* restore the login page

* update screenshots

* tests for auth modal and user profile

* add name field to profile page and write some tests

* [skip ci] clean up and more tests

* update texts

* change text once more

* fix verified email checkmark behaviour

* pass api error to the toast while signing in with wallet

* [skip ci] disable email field on profile page

* bug fixes

* update screenshot

* Blockscout account V2

Fixes #2029

* fix texts and button paddings

* Show "Update metadata" button for instance without metadata

* remove unused components

---------
Co-authored-by: default avataraagaev <alik@agaev.me>
parent 3d84bd4f
...@@ -36,10 +36,6 @@ const AccountActionsMenu = ({ isLoading, className, showUpdateMetadataItem }: Pr ...@@ -36,10 +36,6 @@ const AccountActionsMenu = ({ isLoading, className, showUpdateMetadataItem }: Pr
mixpanel.logEvent(mixpanel.EventTypes.PAGE_WIDGET, { Type: 'Address actions (more button)' }); 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 userWithoutEmail = profileQuery.data && !profileQuery.data.email;
const items = [ const items = [
...@@ -49,15 +45,15 @@ const AccountActionsMenu = ({ isLoading, className, showUpdateMetadataItem }: Pr ...@@ -49,15 +45,15 @@ const AccountActionsMenu = ({ isLoading, className, showUpdateMetadataItem }: Pr
}, },
{ {
render: (props: ItemProps) => <TokenInfoMenuItem { ...props }/>, 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' }/>, render: (props: ItemProps) => <PrivateTagMenuItem { ...props } entityType={ isTxPage ? 'tx' : 'address' }/>,
enabled: true, enabled: config.features.account.isEnabled,
}, },
{ {
render: (props: ItemProps) => <PublicTagMenuItem { ...props }/>, render: (props: ItemProps) => <PublicTagMenuItem { ...props }/>,
enabled: !isTxPage && config.features.publicTagsSubmission.isEnabled, enabled: config.features.account.isEnabled && !isTxPage && config.features.publicTagsSubmission.isEnabled,
}, },
].filter(({ enabled }) => enabled); ].filter(({ enabled }) => enabled);
......
...@@ -14,7 +14,7 @@ interface Props { ...@@ -14,7 +14,7 @@ interface Props {
const ButtonItem = ({ className, label, onClick, icon, isDisabled }: Props) => { const ButtonItem = ({ className, label, onClick, icon, isDisabled }: Props) => {
return ( return (
<Tooltip label={ label }> <Tooltip label={ label } isDisabled={ isDisabled }>
<IconButton <IconButton
aria-label={ label } aria-label={ label }
className={ className } className={ className }
......
...@@ -105,7 +105,7 @@ const TokenInstancePageTitle = ({ isLoading, token, instance, hash }: Props) => ...@@ -105,7 +105,7 @@ const TokenInstancePageTitle = ({ isLoading, token, instance, hash }: Props) =>
) } ) }
{ !isLoading && <AddressAddToWallet token={ token } variant="button"/> } { !isLoading && <AddressAddToWallet token={ token } variant="button"/> }
<AddressQrCode address={ address } isLoading={ isLoading }/> <AddressQrCode address={ address } isLoading={ isLoading }/>
<AccountActionsMenu isLoading={ isLoading } showUpdateMetadataItem={ Boolean(instance?.metadata) }/> <AccountActionsMenu isLoading={ isLoading } showUpdateMetadataItem/>
{ appLink } { appLink }
</Flex> </Flex>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment