Skip to content

Commit

Permalink
fix: Adjust connection center design
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Nov 6, 2023
1 parent 010faca commit 7aea373
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/common/ConnectWallet/ConnectionCenter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Popover, ButtonBase, Typography, Paper } from '@mui/material'
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import ExpandLessIcon from '@mui/icons-material/ExpandLess'
import classnames from 'classnames'
import { useState, type MouseEvent, type ReactElement } from 'react'

import KeyholeIcon from '@/components/common/icons/KeyholeIcon'
Expand Down Expand Up @@ -29,7 +30,6 @@ const ConnectionCenter = (): ReactElement => {

<Typography variant="caption" className={css.notConnected}>
<b>Not connected</b>
<br />
<Typography variant="inherit" sx={{ color: ({ palette }) => palette.error.main }}>
Connect wallet
</Typography>
Expand All @@ -52,7 +52,7 @@ const ConnectionCenter = (): ReactElement => {
}}
sx={{ mt: 1 }}
>
<Paper className={css.popoverContainer}>
<Paper className={classnames(css.popoverContainer, css.largeGap)}>
<WalletDetails onConnect={handleClose} />
</Paper>
</Popover>
Expand Down
8 changes: 6 additions & 2 deletions src/components/common/ConnectWallet/WalletDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Divider, Typography } from '@mui/material'
import { Box, Divider, SvgIcon, Typography } from '@mui/material'
import type { ReactElement } from 'react'

import LockIcon from '@/public/images/common/lock.svg'
Expand All @@ -8,7 +8,11 @@ import WalletLogin from '@/components/welcome/WelcomeLogin/WalletLogin'
const WalletDetails = ({ onConnect }: { onConnect: () => void }): ReactElement => {
return (
<>
<LockIcon />
<Box my={1}>
<SvgIcon inheritViewBox sx={{ width: 64, height: 64, display: 'block' }}>
<LockIcon />
</SvgIcon>
</Box>

<WalletLogin onLogin={onConnect} />

Expand Down
4 changes: 4 additions & 0 deletions src/components/common/ConnectWallet/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
border: 1px solid var(--color-border-light);
}

.largeGap {
gap: var(--space-2);
}

.addressName {
text-align: center;
overflow: hidden;
Expand Down
33 changes: 28 additions & 5 deletions src/components/common/icons/KeyholeIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
import Keyhole from '@/components/common/icons/KeyholeIcon/keyhole.svg'
import css from '@/components/common/icons/CircularIcon/styles.module.css'
import LockIcon from '@/public/images/common/lock.svg'
import { Badge, SvgIcon } from '@mui/material'

import CircularIcon from '../CircularIcon'

const KeyholeIcon = ({ size = 40 }: { size?: number }) => {
return <CircularIcon icon={Keyhole} badgeColor="error" size={size} />
const KeyholeIcon = ({ size = 28 }: { size?: number }) => {
return (
<Badge
color="error"
overlap="circular"
variant="dot"
anchorOrigin={{
vertical: 'bottom',
horizontal: 'right',
}}
className={css.badge}
>
<SvgIcon
component={LockIcon}
inheritViewBox
sx={{
height: size,
width: size,
'& path': {
fill: ({ palette }) => palette.border.main,
},
}}
/>
</Badge>
)
}

export default KeyholeIcon
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ONBOARD_MPC_MODULE_LABEL } from '@/services/mpc/SocialLoginModule'

const mockChainInfo = {
chainId: '100',
chainName: 'Gnosis Chain',
l2: false,
nativeCurrency: {
symbol: 'ETH',
Expand Down
2 changes: 1 addition & 1 deletion src/components/new-safe/create/steps/ReviewStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const NetworkFee = ({
height={16}
style={{ margin: '-3px 0px -3px 4px' }}
/>{' '}
Gnosis Chain
{chain?.chainName}
</Typography>
</>
)
Expand Down

0 comments on commit 7aea373

Please sign in to comment.