Skip to content

Commit 22d5dc8

Browse files
committed
fix: improve UI accessibility and dark-mode icon rendering
1 parent 6bceeb3 commit 22d5dc8

12 files changed

Lines changed: 119 additions & 55 deletions

File tree

apps/web/public/why-dark.svg

Lines changed: 51 additions & 0 deletions
Loading

apps/web/src/layouts/DefaultLayout/Nav.styles.css.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,13 @@ export const navPopUpWrapper = style({
316316
export const wrongNetworkButton = style({
317317
transition:
318318
'border 0.1s ease-in-out, background 0.1s ease-in-out, transform 0.1s ease-out',
319-
background: vars.color.negativeDisabled,
320-
color: color.negative,
319+
borderWidth: 'normal',
320+
borderStyle: 'solid',
321+
borderColor: vars.color.negative,
322+
color: vars.color.negative,
321323
selectors: {
322324
'&:hover': {
323-
background: vars.color.negative,
325+
background: vars.color.negativeDisabled,
324326
},
325327
},
326328
})

apps/web/src/layouts/DefaultLayout/NavMenu/ProfileMenu.tsx

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -206,56 +206,13 @@ export const ProfileMenu: React.FC<ProfileMenuProps> = ({
206206

207207
const onDisconnect = useWalletDisconnect()
208208

209-
const renderConnectedUser = () => (
210-
<>
211-
<Flex direction={'column'} align={'stretch'} gap={'x2'}>
212-
<Flex direction={'row'} align={'center'} justify={'space-between'} w={'100%'}>
213-
<Link
214-
href={`/profile/${address}`}
215-
passHref
216-
target="_blank"
217-
rel="noopener noreferrer"
218-
style={{ textDecoration: 'none', flex: 1 }}
219-
>
220-
<Flex
221-
direction={'row'}
222-
align={'center'}
223-
className={profileRow}
224-
aria-label="Open profile"
225-
>
226-
<Avatar address={address!} src={ensAvatar} size={'40'} />
227-
<Flex direction={'column'} ml={'x2'}>
228-
<Text fontWeight={'display'}>{displayName}</Text>
229-
<Text variant={'paragraph-md'} color={'tertiary'}>
230-
{userBalance}
231-
</Text>
232-
</Flex>
233-
</Flex>
234-
</Link>
235-
<CopyButton text={address!} />
236-
</Flex>
237-
238-
<Button
239-
className={disconnectButton}
240-
variant={'outline'}
241-
color="negative"
242-
onClick={onDisconnect}
243-
id={'close-modal'}
244-
>
245-
Disconnect
246-
</Button>
247-
</Flex>
248-
<Box color="border" borderStyle="solid" borderWidth="thin" />
249-
</>
250-
)
251-
252-
const renderConnectedUserStatic = () => (
209+
const renderConnectedUserCommon = ({ isStatic = false }: { isStatic?: boolean }) => (
253210
<>
254211
<Flex
255212
direction={'column'}
256213
align={'stretch'}
257214
gap={'x2'}
258-
style={{ paddingBottom: '8px' }}
215+
style={isStatic ? { paddingBottom: '8px' } : undefined}
259216
>
260217
<Flex direction={'row'} align={'center'} justify={'space-between'} w={'100%'}>
261218
<Link
@@ -297,6 +254,10 @@ export const ProfileMenu: React.FC<ProfileMenuProps> = ({
297254
</>
298255
)
299256

257+
const renderConnectedUser = () => renderConnectedUserCommon({ isStatic: false })
258+
259+
const renderConnectedUserStatic = () => renderConnectedUserCommon({ isStatic: true })
260+
300261
const renderUserContent = (isMobileFullscreen = false, showCreateButton = true) => (
301262
<>
302263
{daos.length > 0 && (

apps/web/src/pages/about.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Link from 'next/link'
77
import { useRouter } from 'next/router'
88
import React, { useCallback } from 'react'
99
import { getDefaultLayout } from 'src/layouts/DefaultLayout'
10-
import { whyCreateButton, whyTextStyle } from 'src/styles/about.css'
10+
import { darkWhy, lightWhy, whyCreateButton, whyTextStyle } from 'src/styles/about.css'
1111

1212
import { NextPageWithLayout } from './_app'
1313

@@ -35,7 +35,21 @@ const AboutPage: NextPageWithLayout = () => {
3535
width={'100%'}
3636
px={'x4'}
3737
>
38-
<Image src={'/why.svg'} alt="why" style={{ alignSelf: 'center' }} width={500} />
38+
<Image
39+
src={'/why.svg'}
40+
alt="why"
41+
style={{ alignSelf: 'center' }}
42+
width={500}
43+
className={lightWhy}
44+
/>
45+
<Image
46+
src={'/why-dark.svg'}
47+
alt={''}
48+
aria-hidden={true}
49+
style={{ alignSelf: 'center' }}
50+
width={500}
51+
className={darkWhy}
52+
/>
3953

4054
<Box>
4155
Nouns Builder makes it easy for communities and collectives to create Nounish

apps/web/src/styles/about.css.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,23 @@ export const whyCreateButton = style({
1515
},
1616
},
1717
})
18+
19+
const darkWordSelector = 'html[data-theme-mode="dark"] &'
20+
21+
export const lightWhy = style({
22+
display: 'block',
23+
selectors: {
24+
[darkWordSelector]: {
25+
display: 'none',
26+
},
27+
},
28+
})
29+
30+
export const darkWhy = style({
31+
display: 'none',
32+
selectors: {
33+
[darkWordSelector]: {
34+
display: 'block',
35+
},
36+
},
37+
})

packages/proposal-ui/src/constants/transactionTypes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const TRANSACTION_TYPES: TransactionTypesPropsMap = {
8383
title: 'Fix Metadata Renderer Base',
8484
subTitle: 'Restore NFT image visibility on external marketplaces',
8585
icon: 'spanner',
86+
iconFill: 'warningStrong',
8687
iconBackdrop: iconBackdrop(color.warning),
8788
},
8889
[TransactionType.RESUME_AUCTIONS]: {
@@ -114,7 +115,7 @@ export const TRANSACTION_TYPES: TransactionTypesPropsMap = {
114115
title: 'Migration',
115116
subTitle: 'Migrate from L1 to L2',
116117
icon: 'migrate',
117-
iconBackdrop: `color-mix(in srgb, ${color.warning} 10%, transparent)`,
118+
iconBackdrop: iconBackdrop(color.warning),
118119
},
119120
[TransactionType.WALLET_CONNECT]: {
120121
title: 'WalletConnect',

packages/ui/src/Tooltip/Tooltip.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { Box, Icon, PopUp } from '@buildeross/zord'
22
import { useRef, useState } from 'react'
33

4-
export const Tooltip = ({ children }: { children: string }) => {
4+
export const Tooltip = ({
5+
children,
6+
label = 'Help',
7+
}: {
8+
children: string
9+
label?: string
10+
}) => {
511
const [showTooltip, setShowTooltip] = useState(false)
612
const triggerRef = useRef<HTMLDivElement | null>(null)
713

@@ -17,8 +23,9 @@ export const Tooltip = ({ children }: { children: string }) => {
1723
ref={triggerRef}
1824
tabIndex={0}
1925
color="text3"
26+
aria-label={label}
2027
>
21-
<Icon id="question" size="sm" />
28+
<Icon id="question" size="sm" aria-hidden />
2229
</Box>
2330
<PopUp
2431
open={showTooltip}

packages/zord/src/assets/brand/content-coin.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/zord/src/assets/monochrome/spanner.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/zord/src/theme.css.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export const theme = createThemeContract({
195195
warningDisabled: '',
196196
onWarning: '',
197197
onWarningDisabled: '',
198+
warningStrong: '',
198199
negative: '',
199200
negativeHover: '',
200201
negativeActive: '',

0 commit comments

Comments
 (0)