Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adjust connection center design #2745

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
31 changes: 26 additions & 5 deletions src/components/common/icons/KeyholeIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
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
color="border"
component={LockIcon}
inheritViewBox
sx={{
height: size,
width: size,
}}
/>
</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
2 changes: 1 addition & 1 deletion src/components/sidebar/SafeList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const SafeList = ({ closeDrawer }: { closeDrawer?: () => void }): ReactElement =
) : (
<Box display="flex" flexDirection="column" alignItems="center" gap={3} maxWidth={250}>
<Box display="flex" alignItems="center" justifyContent="center">
<KeyholeIcon />
<KeyholeIcon size={40} />
</Box>

<Typography variant="body2" color="primary.light" textAlign="center" sx={{ textWrap: 'balance' }}>
Expand Down
Loading