Skip to content

Commit

Permalink
fix: Show an orange badge if mfa is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Oct 31, 2023
1 parent f69f536 commit 356b40b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/components/common/ConnectWallet/ConnectionCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import KeyholeIcon from '@/components/common/icons/KeyholeIcon'
import WalletDetails from '@/components/common/ConnectWallet/WalletDetails'

import css from '@/components/common/ConnectWallet/styles.module.css'
import { useCurrentChain } from '@/hooks/useChains'

const ConnectionCenter = (): ReactElement => {
const chain = useCurrentChain()

const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null)
const open = !!anchorEl

Expand Down
1 change: 1 addition & 0 deletions src/components/common/ConnectWallet/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
align-items: center;
text-align: left;
gap: var(--space-1);
padding: 0 var(--space-2);
}

.popoverContainer {
Expand Down
7 changes: 5 additions & 2 deletions src/components/common/SocialLoginInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Typography } from '@mui/material'
import { Badge, Box, Typography } from '@mui/material'
import css from './styles.module.css'
import { type ChainInfo } from '@safe-global/safe-gateway-typescript-sdk'
import { type ConnectedWallet } from '@/services/onboard'
Expand Down Expand Up @@ -28,7 +28,10 @@ const SocialLoginInfo = ({

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" />
<Box position="relative">
<img src={userInfo.profileImage} className={css.profileImg} alt="Profile Image" referrerPolicy="no-referrer" />
{!socialWalletService?.isMFAEnabled() && <Badge variant="dot" color="warning" className={css.bubble} />}
</Box>
<div className={css.profileData}>
<Typography className={css.text} variant="body2" fontWeight={700}>
{userInfo.name}
Expand Down
16 changes: 14 additions & 2 deletions src/components/common/SocialLoginInfo/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
.profileImg {
border-radius: var(--space-2);
width: 32px;
height: 32px;
width: 28px;
height: 28px;
display: block;
}

.bubble {
content: '';
position: absolute;
right: 3px;
bottom: 3px;
}

.bubble span {
outline: 1px solid var(--color-background-paper);
}

.profileData {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/WalletOverview/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
display: none;
}

.socialLoginInfo > div > div {
.socialLoginInfo > div > div:last-child {
display: none;
}
}

0 comments on commit 356b40b

Please sign in to comment.