Skip to content

Commit 817b58e

Browse files
fix the AddIcon color in faq section
1 parent 892e376 commit 817b58e

File tree

1 file changed

+48
-40
lines changed
  • src/components/home/sections

1 file changed

+48
-40
lines changed

src/components/home/sections/FAQ.tsx

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
import { Accordion, AccordionDetails, AccordionSummary, Grid, Typography } from "@mui/material";
1+
import {
2+
Accordion,
3+
AccordionDetails,
4+
AccordionSummary,
5+
Grid,
6+
Typography,
7+
} from "@mui/material";
28
import React, { Dispatch, SetStateAction, useState } from "react";
39
import { AccordionWrapper, FAQWrapper } from "../styles";
4-
import AddIcon from '@mui/icons-material/Add';
5-
import RemoveIcon from '@mui/icons-material/Remove';
10+
import AddIcon from "@mui/icons-material/Add";
11+
import RemoveIcon from "@mui/icons-material/Remove";
612
import { FAQ_DATA } from "~/lib/constants";
713

814
interface ISimpleAccordionProps {
9-
id: number | false,
10-
expanded: number | false,
11-
setExpanded: Dispatch<SetStateAction<number | false>>,
12-
title: string,
13-
description: string,
15+
id: number | false;
16+
expanded: number | false;
17+
setExpanded: Dispatch<SetStateAction<number | false>>;
18+
title: string;
19+
description: string;
1420
}
1521

1622
const SimpleAccordion: React.FC<ISimpleAccordionProps> = (props) => {
17-
18-
const handleChange = (panel: number | false) => (event: React.SyntheticEvent<Element, Event>, isExpanded: boolean) => {
19-
props.setExpanded(isExpanded ? panel : false);
20-
};
23+
const handleChange =
24+
(panel: number | false) =>
25+
(event: React.SyntheticEvent<Element, Event>, isExpanded: boolean) => {
26+
props.setExpanded(isExpanded ? panel : false);
27+
};
2128

2229
return (
2330
<div data-aos="fade-up" data-aos-delay="500">
@@ -26,53 +33,55 @@ const SimpleAccordion: React.FC<ISimpleAccordionProps> = (props) => {
2633
onChange={handleChange(props.id)}
2734
>
2835
<AccordionSummary
29-
expandIcon={props.expanded === props.id ? <RemoveIcon /> : <AddIcon />}
36+
expandIcon={
37+
props.expanded === props.id ? (
38+
<RemoveIcon />
39+
) : (
40+
<AddIcon style={{ color: "#c0d5ff" }} />
41+
)
42+
}
3043
classes={{
31-
root: 'icon',
32-
expanded: 'icon',
44+
root: "icon",
45+
expanded: "icon",
3346
}}
3447
aria-controls="panel1a-content"
3548
id="panel1a-header"
3649
>
37-
<Typography className={'heading'}>{props.title}</Typography>
50+
<Typography className={"heading"}>{props.title}</Typography>
3851
</AccordionSummary>
39-
<AccordionDetails style={{padding: 0}}>
40-
<Typography className={'description'}>
41-
{props.description}
42-
</Typography>
52+
<AccordionDetails style={{ padding: 0 }}>
53+
<Typography className={"description"}>{props.description}</Typography>
4354
</AccordionDetails>
4455
</AccordionWrapper>
4556
</div>
46-
)
47-
}
57+
);
58+
};
4859

4960
const FAQ = () => {
50-
5161
const [expanded, setExpanded] = useState<number | false>(false);
5262

5363
return (
5464
<FAQWrapper data-aos="fade-up" data-aos-delay="200">
5565
<Grid container>
56-
<Typography variant="h2" gutterBottom className={'title'}>
66+
<Typography variant="h2" gutterBottom className={"title"}>
5767
FAQ&apos;s
5868
</Typography>
5969
<Grid container>
6070
{FAQ_DATA.map((item, index) => (
61-
<Grid item xs={12} sm={6} key={index}>
62-
{item.map(faq => (
63-
<SimpleAccordion
64-
key={faq.id}
65-
expanded={expanded}
66-
setExpanded={setExpanded}
67-
{...faq}
68-
/>
69-
))}
70-
</Grid>
71+
<Grid item xs={12} sm={6} key={index}>
72+
{item.map((faq) => (
73+
<SimpleAccordion
74+
key={faq.id}
75+
expanded={expanded}
76+
setExpanded={setExpanded}
77+
{...faq}
78+
/>
79+
))}
80+
</Grid>
7181
))}
72-
7382
</Grid>
7483
</Grid>
75-
{/* <Grid container>
84+
{/* <Grid container>
7685
<Typography variant="h2" gutterBottom className={classes.title}>
7786
FAQ's
7887
</Typography>
@@ -140,9 +149,8 @@ const FAQ = () => {
140149
</Grid>
141150
</Grid>
142151
</Grid> */}
143-
144152
</FAQWrapper>
145-
)
146-
}
153+
);
154+
};
147155

148-
export default FAQ;
156+
export default FAQ;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy