Created the Question.jsx
This commit is contained in:
parent
69c8106f64
commit
ba2c5ed009
20
src/pages/Help/components/Question/Question.jsx
Normal file
20
src/pages/Help/components/Question/Question.jsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {Collapse, Stack, Typography} from "@mui/material";
|
||||||
|
import {ExpandMore} from "@mui/icons-material";
|
||||||
|
import {useState} from "react";
|
||||||
|
|
||||||
|
export const Question = ({question, answer}) => {
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack direction="column" sx={{border: "1px solid #E0E0E0", borderRadius: 2, p: 2}}>
|
||||||
|
<Stack direction="row" justifyContent="space-between" alignItems="center" onClick={() => setOpen(!open)}
|
||||||
|
sx={{cursor: "pointer"}}>
|
||||||
|
<Typography variant="h5" fontWeight={700} color="black">{question}?</Typography>
|
||||||
|
<ExpandMore sx={{transform: open ? "rotate(180deg)" : "rotate(0deg)", transition: "0.3s"}}/>
|
||||||
|
</Stack>
|
||||||
|
<Collapse in={open}>
|
||||||
|
<Typography variant="body1" fontWeight={500} color="black">{answer}</Typography>
|
||||||
|
</Collapse>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user