Skip to content

Commit 70d34e7

Browse files
committed
Use new tabs in FilterButtons component
1 parent 19f9db2 commit 70d34e7

1 file changed

Lines changed: 10 additions & 31 deletions

File tree

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import Box from '@mui/material/Box'
2-
import Chip from '@mui/material/Chip'
3-
import Typography from '@mui/material/Typography'
4-
import { COLORS } from '../../../styles/theme/colors'
1+
import { Tabs, TabsList, TabsTrigger } from '@oasisprotocol/ui-library/src/components/tabs'
52

63
type FilterButtonsProps<T extends string> = {
74
options: { label: string; value: T }[]
@@ -11,32 +8,14 @@ type FilterButtonsProps<T extends string> = {
118

129
export const FilterButtons = <T extends string>({ options, onSelect, value }: FilterButtonsProps<T>) => {
1310
return (
14-
<Box sx={{ display: 'inline-flex' }}>
15-
{options.map(option => {
16-
const selected = option.value === value
17-
return (
18-
<Chip
19-
key={option.value}
20-
onClick={() => onSelect(option.value)}
21-
clickable
22-
color="secondary"
23-
label={
24-
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
25-
<Typography component="span" sx={{ fontSize: 16 }}>
26-
{option.label}
27-
</Typography>
28-
</Box>
29-
}
30-
sx={{
31-
mr: 3,
32-
borderColor: COLORS.brandMedium,
33-
backgroundColor: selected ? COLORS.brandMedium : COLORS.brandMedium15,
34-
color: selected ? COLORS.white : COLORS.grayExtraDark,
35-
}}
36-
variant={selected ? 'outlined-selected' : 'outlined'}
37-
/>
38-
)
39-
})}
40-
</Box>
11+
<Tabs defaultValue={value}>
12+
<TabsList>
13+
{options.map(option => (
14+
<TabsTrigger key={option.value} value={option.value} onClick={() => onSelect(option.value)}>
15+
{option.label}
16+
</TabsTrigger>
17+
))}
18+
</TabsList>
19+
</Tabs>
4120
)
4221
}

0 commit comments

Comments
 (0)