mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* basic login button implementation * refactoring and add dynamic auth button to the other pages * connect wallet without authenticating an user * login and logout user in blockscout account * refactoring and RPC overrides * authenticate user with connected wallet * add ENS to profile button * override evm chains and fix contract write with waas wallet * disconnect wallet and fix docker build * add dynamic imports to components that use web3 wallet packages * refactor user profile directory * clean up * tweaks * update pw ci script * fix "connect wallet" button behavior * handle linking email to profile with dynamic provider * fix test * async loading web3 hooks and remove dynamic loading from components that use them * fix pw tests * add account navigation in horizontal layout when auth provider is dynamic * fix address verification modal * review fixes * spelling fixes
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
|
|
import config from 'configs/app';
|
|
import { Alert } from 'toolkit/chakra/alert';
|
|
import { Button } from 'toolkit/chakra/button';
|
|
import { useDisclosure } from 'toolkit/hooks/useDisclosure';
|
|
import AuthModal from 'ui/snippets/auth/AuthModal';
|
|
import useLinkEmail from 'ui/snippets/auth/linkEmail/useLinkEmail';
|
|
|
|
const feature = config.features.account;
|
|
|
|
const VerifiedAddressesEmailAlert = () => {
|
|
const authModal = useDisclosure();
|
|
const linkEmail = useLinkEmail();
|
|
|
|
const handleButtonClick = React.useCallback(() => {
|
|
if (feature.isEnabled && feature.authProvider === 'dynamic') {
|
|
linkEmail();
|
|
} else {
|
|
authModal.onOpen();
|
|
}
|
|
}, [ authModal, linkEmail ]);
|
|
|
|
return (
|
|
<>
|
|
<Alert
|
|
status="warning"
|
|
mb={ 6 }
|
|
descriptionProps={{
|
|
alignItems: 'center',
|
|
gap: 2,
|
|
}}
|
|
>
|
|
You need a valid email address to verify contracts. Please add your email to your account.
|
|
<Button variant="outline" size="sm" onClick={ handleButtonClick }>Add email</Button>
|
|
</Alert>
|
|
{ authModal.open && <AuthModal initialScreen={{ type: 'email', isAuth: true }} onClose={ authModal.onClose }/> }
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default React.memo(VerifiedAddressesEmailAlert);
|