-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a2cfc2
commit 0740b98
Showing
5 changed files
with
182 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { useState } from "react"; | ||
import { SlArrowDown, SlArrowUp } from "react-icons/sl"; | ||
import { FAQ } from "../config"; | ||
|
||
const Section = ({id, title, description, isVisible, setIsVisible }) => { | ||
|
||
return ( | ||
|
||
<div className="flex flex-col shadow rounded-md p-2.5 m-2.5"> | ||
<div className="flex justify-between"> | ||
<h3 className="font-semibold text-lg text-title">{title}</h3> | ||
{ | ||
isVisible ? ( | ||
<SlArrowUp onClick={() => setIsVisible({id : id, status : false})} className="cursor-pointer" /> | ||
) : ( | ||
<SlArrowDown onClick={() => setIsVisible({id : id, status : true})} className="cursor-pointer" /> | ||
)} | ||
</div> | ||
{isVisible && <p className="text-bio text-base">{description}</p>} | ||
</div> | ||
); | ||
}; | ||
|
||
const Help = () => { | ||
const [visibleSection, setIsvisibleSection] = useState( | ||
{ | ||
id : 1, | ||
status : false | ||
}); /* Initial Dummy value */ | ||
|
||
return ( | ||
<div className="container"> | ||
<div className="card-container"> | ||
<h1 className="card-container-title pb-5"> FAQ</h1> | ||
{FAQ.map((question) => { | ||
return ( | ||
<Section key={question.id} id={question.id} title={question.title} description={question.description} | ||
isVisible={visibleSection.status && visibleSection.id === question.id } | ||
setIsVisible={(obj) => setIsvisibleSection(obj)} | ||
/> | ||
|
||
) | ||
} | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Help; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters