Download NetflixClone/src/components/UI/FAQComponent/FAQComponent.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 808 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/NetflixClone/src/components/UI/FAQComponent/FAQComponent.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/NetflixClone/src/components/UI/FAQComponent/FAQComponent.js
-
curl -L -o FAQComponent.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/NetflixClone/src/components/UI/FAQComponent/FAQComponent.js
808 Bytes
| import React from "react"; | |
| import "./FAQComponent.css"; | |
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | |
| import { faPlus, faMinus } from "@fortawesome/free-solid-svg-icons"; | |
| import { CSSTransition } from 'react-transition-group' | |
| const faqComponent = props => { | |
| const { faqOpenHandler, text, boxOpen, boxText } = props | |
| return ( | |
| <> | |
| <div | |
| className="faqComponent" | |
| onClick={faqOpenHandler} | |
| > | |
| <div>{text}</div> | |
| <FontAwesomeIcon icon={boxOpen ? faMinus : faPlus} /> | |
| </div> | |
| <CSSTransition in={boxOpen} classNames="faq-animation" timeout={500} unmountOnExit> | |
| <div className="faqComponent" style={{ marginTop: "1.5px" }}> | |
| {boxText} | |
| </div> | |
| </CSSTransition> | |
| </> | |
| ); | |
| }; | |
| export default faqComponent; | |