Skip to content

Commit 94c917e

Browse files
committed
chore: wrap with h3 and replace btn
1 parent 487e91e commit 94c917e

File tree

1 file changed

+51
-54
lines changed

1 file changed

+51
-54
lines changed

src/components/ExpandableCard.tsx

Lines changed: 51 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
Button,
1616
Fade,
1717
Heading,
18-
Text as ChakraText,
18+
Text,
1919
} from "@chakra-ui/react"
2020

2121
export interface IProps {
@@ -70,69 +70,66 @@ const ExpandableCard: React.FC<IProps> = ({
7070
index={isVisible ? [0] : []}
7171
>
7272
<AccordionItem borderTopWidth="0" flex="1">
73-
<AccordionButton
74-
width="100%"
75-
padding={`1.5rem 1.5rem ${isVisible ? "0" : "1.5rem"}`}
76-
flex="1"
77-
onClick={onClick}
78-
_hover={{
79-
backgroundColor: "ednBackground",
80-
}}
81-
>
82-
<Box
83-
display="flex"
73+
<h3 style={{ margin: 0 }}>
74+
<AccordionButton
8475
width="100%"
85-
alignItems="center"
86-
flexDir={{ base: "column", sm: "row" }}
76+
padding={`1.5rem 1.5rem ${isVisible ? "0" : "1.5rem"}`}
77+
flex="1"
78+
onClick={onClick}
79+
_hover={{
80+
backgroundColor: "ednBackground",
81+
}}
8782
>
8883
<Box
89-
marginBottom={{ base: "0.5rem", sm: 0 }}
90-
marginRight={{ base: 0, sm: "1rem" }}
84+
display="flex"
85+
width="100%"
86+
alignItems="center"
87+
flexDir={{ base: "column", sm: "row" }}
9188
>
9289
<Box
93-
display="flex"
94-
alignItems="center"
95-
sx={{
96-
svg: { marginRight: "1.5rem" },
97-
}}
98-
margin="1rem 0"
90+
marginBottom={{ base: "0.5rem", sm: 0 }}
91+
marginRight={{ base: 0, sm: "1rem" }}
9992
>
100-
{!!Svg && <Svg />}
101-
<Heading
102-
as="h3"
103-
size="md"
104-
fontWeight="semibold"
105-
flex="1"
106-
marginTop="0rem"
107-
marginBottom="0.5rem"
93+
<Box
94+
display="flex"
95+
alignItems="center"
96+
sx={{
97+
svg: { marginRight: "1.5rem" },
98+
}}
99+
margin="1rem 0"
108100
>
109-
{title}
110-
</Heading>
101+
{!!Svg && <Svg />}
102+
<Text
103+
fontSize="xl"
104+
fontWeight="semibold"
105+
flex="1"
106+
marginTop="0rem"
107+
marginBottom="0.5rem"
108+
>
109+
{title}
110+
</Text>
111+
</Box>
112+
<Text
113+
fontSize="sm"
114+
color="text200"
115+
marginBottom="0"
116+
width="fit-content"
117+
>
118+
{contentPreview}
119+
</Text>
111120
</Box>
112-
<ChakraText
113-
fontSize="sm"
114-
color="text200"
115-
marginBottom="0"
116-
width="fit-content"
121+
<Text
122+
fontSize="md"
123+
color="primary"
124+
ml={{ base: undefined, sm: "auto" }}
125+
mt="auto"
126+
mb="auto"
117127
>
118-
{contentPreview}
119-
</ChakraText>
128+
<Translation id={isVisible ? "less" : "more"} />
129+
</Text>
120130
</Box>
121-
<Button
122-
as="div" // we do not want to nest a button in a button
123-
ml={{ base: undefined, sm: "auto" }}
124-
onClick={onClick}
125-
variant="link"
126-
color="primary"
127-
_hover={{
128-
boxShadow: "none",
129-
textDecoration: "none",
130-
}}
131-
>
132-
<Translation id={isVisible ? "less" : "more"} />
133-
</Button>
134-
</Box>
135-
</AccordionButton>
131+
</AccordionButton>
132+
</h3>
136133
<AccordionPanel
137134
paddingX="1.5rem"
138135
paddingBottom="1.5rem"

0 commit comments

Comments
 (0)