-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from flotiq/feature/24513-faq-section-in-blog-…
…post Ref. #24513 Faq section added to blog post
- Loading branch information
Showing
5 changed files
with
89 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
// :: Components | ||
import Accordion from 'react-bootstrap/Accordion'; | ||
|
||
// :: Images | ||
import arrowDownIcon from '../../assets/arrow-down.svg'; | ||
|
||
function Faq({ faqs}) { | ||
if (!faqs || faqs.length === 0) { | ||
return null | ||
} | ||
return ( | ||
<div className="mt-5"> | ||
<h2 className="text-center">Frequently Asked Questions</h2> | ||
<div className="faqs mt-4"> | ||
<Accordion className="faq"> | ||
{faqs?.map(faq => ( | ||
<Accordion.Item className="border-bottom py-2 my-2" key={faq.question} eventKey={faq.question}> | ||
<Accordion.Header as='h3' className="text-left font-bold faq__question"> | ||
{faq.question} | ||
<img src={arrowDownIcon} alt="arrow icon" className="ml-5" /> | ||
</Accordion.Header> | ||
<Accordion.Body className="faq__answer"> | ||
{faq.answer} | ||
</Accordion.Body> | ||
</Accordion.Item> | ||
))} | ||
</Accordion> | ||
</div> | ||
</div> | ||
); | ||
} | ||
export default Faq; |
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,31 @@ | ||
.faqs { | ||
.faq { | ||
&__question { | ||
font-size: 1rem; | ||
} | ||
|
||
&__answer { | ||
padding-bottom: .8rem; | ||
} | ||
} | ||
|
||
.accordion-button { | ||
width: 100%; | ||
text-align: left; | ||
font-weight: 600; | ||
padding-bottom: .5rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
|
||
img { | ||
width: .8rem; | ||
transform: rotate(180deg); | ||
transition: transform .3s; | ||
} | ||
|
||
&.collapsed img { | ||
transform: rotate(0deg); | ||
} | ||
} | ||
} |
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