Skip to content

Commit b1d2ac8

Browse files
committed
fix filter button a11y and hover effects
update to Chakra-UI Text component for clean up
1 parent 060e0d5 commit b1d2ac8

File tree

1 file changed

+37
-65
lines changed

1 file changed

+37
-65
lines changed

src/pages/wallets/find-wallet.tsx

Lines changed: 37 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
Hide,
1313
DrawerHeader,
1414
Show,
15+
Text,
1516
} from "@chakra-ui/react"
1617
import React, { useState } from "react"
1718
import { graphql } from "gatsby"
@@ -25,7 +26,6 @@ import PageMetadata from "../../components/PageMetadata"
2526
import Translation from "../../components/Translation"
2627
import WalletFilterSidebar from "../../components/FindWallet/WalletFilterSidebar"
2728
import WalletTable from "../../components/FindWallet/WalletTable"
28-
import Text from "../../components/OldText"
2929
import OldHeading from "../../components/OldHeading"
3030
import GatsbyImage from "../../components/GatsbyImage"
3131

@@ -41,21 +41,19 @@ import { getImage } from "../../utils/image"
4141

4242
import type { ChildOnlyProp } from "../../types"
4343
import { NAV_BAR_PX_HEIGHT } from "../../constants"
44+
import { Button } from "../../components/Buttons"
4445

45-
const Subtitle = ({ children }: ChildOnlyProp) => {
46-
return (
47-
<Text
48-
fontSize="xl"
49-
lineHeight={1.4}
50-
color="text200"
51-
_last={{
52-
mb: 8,
53-
}}
54-
>
55-
{children}
56-
</Text>
57-
)
58-
}
46+
const Subtitle = ({ children }: ChildOnlyProp) => (
47+
<Text
48+
fontSize="xl"
49+
lineHeight={1.4}
50+
color="body.medium"
51+
mb={6}
52+
_last={{ mb: 8 }}
53+
>
54+
{children}
55+
</Text>
56+
)
5957

6058
const filterDefault = {
6159
android: false,
@@ -174,22 +172,19 @@ const FindWalletPage = ({ data, location }) => {
174172
zIndex="docked"
175173
py="5px"
176174
>
177-
<Flex
175+
<Button
176+
rightIcon={<FilterBurgerIcon />}
177+
variant="outline"
178+
borderInlineStart="none"
179+
borderInlineStartRadius="none"
178180
gap={4}
179-
justifyContent="space-between"
180-
alignItems="center"
181-
border="1px solid"
182-
borderColor="primary.base"
183-
borderLeft="none"
184-
borderRightRadius="base"
185-
pt={1.5}
186-
px={5}
187-
pb={2.5}
188-
m="auto"
189-
ml={0}
190-
w="full"
191-
maxW={showMobileSidebar ? "200px" : "200px"}
192-
bg="background.base"
181+
sx={{
182+
svg: {
183+
boxSize: 8,
184+
line: { stroke: "primary.base" },
185+
circle: { stroke: "primary.base" },
186+
},
187+
}}
193188
onClick={() => {
194189
showMobileSidebar ? onClose() : onOpen()
195190
trackCustomEvent({
@@ -198,37 +193,20 @@ const FindWalletPage = ({ data, location }) => {
198193
eventName: `show mobile filters ${!showMobileSidebar}`,
199194
})
200195
}}
201-
sx={{
202-
p: {
203-
m: 0,
204-
},
205-
svg: {
206-
boxSize: 8,
207-
line: {
208-
stroke: "primary.base",
209-
},
210-
circle: {
211-
stroke: "primary.base",
212-
},
213-
},
214-
}}
215196
>
216197
<Box>
217198
<Text>
218199
<Translation id="page-find-wallet-filters" />
219200
</Text>
220-
<Text fontSize="sm" lineHeight="14px" color="text200">
221-
{Object.values(filters).reduce((acc, filter) => {
222-
if (filter) {
223-
acc += 1
224-
}
225-
return acc
226-
}, 0)}{" "}
201+
<Text fontSize="sm" lineHeight="14px" color="body.medium">
202+
{Object.values(filters).reduce(
203+
(acc, filter) => (filter ? acc + 1 : acc),
204+
0
205+
)}{" "}
227206
{t("page-find-wallet-active")}
228207
</Text>
229208
</Box>
230-
<FilterBurgerIcon />
231-
</Flex>
209+
</Button>
232210
</Box>
233211
<Drawer
234212
isOpen={showMobileSidebar}
@@ -321,20 +299,14 @@ const FindWalletPage = ({ data, location }) => {
321299
},
322300
}}
323301
>
324-
<Text>
325-
<Text as="i">
326-
<Translation id="page-find-wallet-footnote-1" />
327-
</Text>
302+
<Text fontStyle="italic">
303+
<Translation id="page-find-wallet-footnote-1" />
328304
</Text>
329-
<Text>
330-
<Text as="i">
331-
<Translation id="page-find-wallet-footnote-2" />
332-
</Text>
305+
<Text fontStyle="italic">
306+
<Translation id="page-find-wallet-footnote-2" />
333307
</Text>
334-
<Text>
335-
<Text as="i">
336-
<Translation id="page-find-wallet-footnote-3" />
337-
</Text>
308+
<Text fontStyle="italic">
309+
<Translation id="page-find-wallet-footnote-3" />
338310
</Text>
339311
</Box>
340312
</Flex>

0 commit comments

Comments
 (0)