Skip to content

Commit 7607677

Browse files
committed
fix theme dark/light mode change
1 parent 7b66b77 commit 7607677

File tree

1 file changed

+28
-40
lines changed

1 file changed

+28
-40
lines changed
Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Stack} from "@mantine/core"
1+
import {Box, Paper, Stack, UnstyledButton} from "@mantine/core"
22
import {IconChevronDown} from "@tabler/icons-react"
33
import React, {useState} from "react"
44
import {DropdownConfig} from "../types"
@@ -45,47 +45,35 @@ export default function FiltersCollapse({filters, className}: Args) {
4545
})
4646

4747
return (
48-
<div className={`filters-collapse ${className}`} style={styles.container}>
49-
<div style={styles.header} onClick={toggleExpanded}>
50-
<IconChevronDown
51-
size={20}
48+
<Paper
49+
className={`filters-collapse ${className}`}
50+
withBorder
51+
radius="sm"
52+
style={{overflow: "hidden"}}
53+
>
54+
<UnstyledButton onClick={toggleExpanded} w="100%" p="xs">
55+
<Box
5256
style={{
53-
...styles.icon,
54-
transform: expanded ? "rotate(0deg)" : "rotate(90deg)"
57+
display: "flex",
58+
alignItems: "center",
59+
justifyContent: "flex-start"
5560
}}
56-
/>
57-
</div>
61+
>
62+
<IconChevronDown
63+
size={20}
64+
style={{
65+
transform: expanded ? "rotate(0deg)" : "rotate(90deg)",
66+
transition: "transform 0.2s ease-in-out"
67+
}}
68+
/>
69+
</Box>
70+
</UnstyledButton>
5871

59-
{expanded && <Stack>{filterComponents}</Stack>}
60-
</div>
72+
{expanded && (
73+
<Box p="sm">
74+
<Stack gap="sm">{filterComponents}</Stack>
75+
</Box>
76+
)}
77+
</Paper>
6178
)
6279
}
63-
64-
const styles: {[key: string]: React.CSSProperties} = {
65-
container: {
66-
width: "100%",
67-
border: "1px solid #e0e0e0",
68-
backgroundColor: "#ffffff",
69-
overflow: "hidden"
70-
},
71-
header: {
72-
display: "flex",
73-
alignItems: "center",
74-
justifyContent: "space-between",
75-
padding: "4px 4px",
76-
backgroundColor: "rgba(0, 0, 0, 0.03)",
77-
cursor: "pointer",
78-
borderBottom: "1px solid #e0e0e0",
79-
transition: "background-color 0.2s ease"
80-
},
81-
icon: {
82-
transition: "transform 0.2s ease-in-out",
83-
color: "#666666"
84-
},
85-
content: {
86-
overflow: "hidden",
87-
transition:
88-
"max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out",
89-
backgroundColor: "#ffffff"
90-
}
91-
}

0 commit comments

Comments
 (0)