-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement account center redesign
- Loading branch information
1 parent
5ab369e
commit f603cd8
Showing
8 changed files
with
142 additions
and
41 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Box, Typography } from '@mui/material' | ||
import css from './styles.module.css' | ||
import { useContext } from 'react' | ||
import { type ChainInfo } from '@safe-global/safe-gateway-typescript-sdk' | ||
import { type ConnectedWallet } from '@/services/onboard' | ||
import { MpcWalletContext } from '@/components/common/ConnectWallet/MPCWalletProvider' | ||
import CopyAddressButton from '@/components/common/CopyAddressButton' | ||
import ExplorerButton from '@/components/common/ExplorerButton' | ||
import { getBlockExplorerLink } from '@/utils/chains' | ||
import { useAppSelector } from '@/store' | ||
import { selectSettings } from '@/store/settingsSlice' | ||
|
||
const SocialLoginInfo = ({ wallet, chainInfo }: { wallet: ConnectedWallet; chainInfo?: ChainInfo }) => { | ||
const { userInfo } = useContext(MpcWalletContext) | ||
const prefix = chainInfo?.shortName | ||
const link = chainInfo ? getBlockExplorerLink(chainInfo, wallet.address) : undefined | ||
const settings = useAppSelector(selectSettings) | ||
|
||
if (!userInfo) return <></> | ||
|
||
return ( | ||
<Box width="100%" display="flex" flexDirection="row" alignItems="center" gap={1}> | ||
<img src={userInfo.profileImage} className={css.profileImg} alt="Profile Image" referrerPolicy="no-referrer" /> | ||
<div className={css.profileData}> | ||
<Typography className={css.text} variant="body2" fontWeight={700}> | ||
{userInfo.name} | ||
</Typography> | ||
<Typography className={css.text} variant="body2"> | ||
{userInfo.email} | ||
</Typography> | ||
</div> | ||
<div className={css.actionButtons}> | ||
<Box color="border.main"> | ||
<CopyAddressButton prefix={prefix} copyPrefix={settings.shortName.copy} address={wallet.address} /> | ||
<ExplorerButton title={link?.title || ''} href={link?.href || ''} /> | ||
</Box> | ||
</div> | ||
</Box> | ||
) | ||
} | ||
|
||
export default SocialLoginInfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.profileImg { | ||
border-radius: var(--space-2); | ||
width: 32px; | ||
height: 32px; | ||
} | ||
|
||
.profileData { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 2px; | ||
} | ||
|
||
.text { | ||
font-size: 12px; | ||
line-height: 14px; | ||
} | ||
|
||
.actionButtons { | ||
display: flex; | ||
justify-self: flex-end; | ||
margin-left: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters