-
Notifications
You must be signed in to change notification settings - Fork 118
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 #409 from nishant0708/FAQ
Feat:Want to Add FAQ Section to The Website #405
- Loading branch information
Showing
4 changed files
with
223 additions
and
2 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,155 @@ | ||
|
||
@import url("https://fonts.googleapis.com/css?family=Hind:300,400&display=swap"); | ||
|
||
.faqs-container { | ||
padding: 2rem; | ||
max-width: 100%; | ||
margin: 0 auto; | ||
} | ||
|
||
.faqs-container * { | ||
box-sizing: border-box; | ||
} | ||
|
||
.faqs-container h2 { | ||
color:#167e32; | ||
font-size: 40px; | ||
text-align: center; | ||
margin-bottom: 1.5rem; | ||
font-family: "ABeeZee", sans-serif; | ||
} | ||
.accordion-title{ | ||
font-size: 22px; | ||
|
||
} | ||
|
||
.accordion{ | ||
margin-top: 70px; | ||
margin-bottom: 30px; | ||
} | ||
|
||
.accordion .accordion-item { | ||
margin-top: 10px; | ||
padding: 0px 10px; | ||
margin-bottom: 10px; | ||
border-bottom: 1px solid #6cdc6e; | ||
} | ||
|
||
.accordion .accordion-item button[aria-expanded='true'] { | ||
border-bottom: 1px solid #03d248; | ||
} | ||
|
||
.accordion button { | ||
position: relative; | ||
display: block; | ||
text-align: left; | ||
width: 100%; | ||
padding: 1em 0; | ||
color: #000000; | ||
font-size: 1.15rem; | ||
font-weight: 400; | ||
border: none; | ||
background: none; | ||
outline: none; | ||
transition: color 0.3s; | ||
} | ||
|
||
.accordion button:hover, | ||
.accordion button:focus { | ||
cursor: pointer; | ||
color: #15b552; | ||
} | ||
|
||
.accordion button { | ||
padding: 1em 1.5em 1em 0; | ||
} | ||
|
||
.accordion button .icon { | ||
display: inline-block; | ||
position: absolute; | ||
top: auto; | ||
right: 0; | ||
width: 22px; | ||
height: 22px; | ||
border: 1px solid; | ||
border-radius: 22px; | ||
} | ||
|
||
.accordion button .icon::before { | ||
display: block; | ||
position: absolute; | ||
content: ""; | ||
top: 9px; | ||
left: 5px; | ||
width: 10px; | ||
height: 2px; | ||
background: currentColor; | ||
} | ||
|
||
.accordion button .icon::after { | ||
display: block; | ||
position: absolute; | ||
content: ""; | ||
top: 5px; | ||
left: 9px; | ||
width: 2px; | ||
height: 10px; | ||
background: currentColor; | ||
} | ||
|
||
.accordion button[aria-expanded='true'] { | ||
color: #12dd63; | ||
} | ||
|
||
.accordion button[aria-expanded='true'] .icon::after { | ||
width: 0; | ||
} | ||
|
||
.accordion .accordion-content { | ||
opacity: 0; | ||
max-height: 0; | ||
overflow: hidden; | ||
transition: opacity 200ms linear, max-height 200ms linear; | ||
} | ||
|
||
#dark .accordion .accordion-content { | ||
color: white; | ||
} | ||
|
||
.accordion .accordion-content.active { | ||
opacity: 0.8; | ||
height: auto; | ||
max-height: 400px; | ||
text-align: left; | ||
padding: 20px; | ||
transition: opacity 200ms linear, max-height 200ms linear; | ||
overflow: auto; | ||
} | ||
|
||
.accordion .accordion-content p { | ||
font-family: 'Hind',sans-serif; | ||
font-size: 18px; | ||
font-weight: 300; | ||
margin: 1em 0; | ||
} | ||
|
||
.repo-link { | ||
color: rgb(59, 59, 234); | ||
text-decoration: underline; | ||
cursor: pointer; | ||
} | ||
@media (max-width:768px) { | ||
.faqs-container h2{ | ||
font-size: 36px; | ||
} | ||
.accordion{ | ||
margin-top: 30px; | ||
} | ||
.accordion .accordion-content.active{ | ||
padding: 10px; | ||
} | ||
} | ||
|
||
|
||
|
||
|
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,63 @@ | ||
// FAQs.jsx | ||
import React, { useState } from 'react'; | ||
import './FAQs.css'; | ||
|
||
const FAQs = () => { | ||
const [activeIndex, setActiveIndex] = useState(null); | ||
|
||
const faqs = [ | ||
{ | ||
question:'How Can I Add Product To User Dasboard', | ||
answer:`You can add a product to your dashboard either by scanning its QR code for automatic data entry on the 'Scan QR' page or by manually entering the product details on the 'Users' page. Both options are available.`, | ||
}, | ||
{ | ||
question:'How can I get notified and adjust the notification duration?', | ||
answer: "You can go to the 'Notified' option and select the notification duration, such as how often you need it (e.g., every 3 days or 5 days), and you will get notified accordingly.", | ||
}, | ||
{ | ||
question:'How can I scan my product QR code?', | ||
answer:"You can go to the 'Scan QR' page and scan your QR code, but remember your QR code should include the manufacturing date, expiry date, and product name.", | ||
}, | ||
{ | ||
question:'Can I contribute to this page?', | ||
answer: ( | ||
<> | ||
Yes, of course! Here is the repository <a href="https://github.com/usha-madithati/esmart.github.io" className="repo-link" target="_blank" rel="noopener noreferrer"> link</a>. | ||
<br/>But make sure to follow our contribution rules and regulations before making any contribution. | ||
</> | ||
), | ||
}, | ||
]; | ||
|
||
const toggleAccordion = (index) => { | ||
setActiveIndex(activeIndex === index ? null : index); | ||
}; | ||
|
||
return ( | ||
<div id="faqs" className="faqs-container"> | ||
<h2>Frequently Asked Questions</h2> | ||
<div className="accordion"> | ||
{faqs.map((faq, index) => ( | ||
<div key={index} className="accordion-item"> | ||
<button | ||
onClick={() => toggleAccordion(index)} | ||
aria-expanded={activeIndex === index ? 'true' : 'false'} | ||
> | ||
<div> | ||
<span className="accordion-title">{faq.question}</span> | ||
<span className="icon" aria-hidden="true"></span> | ||
</div> | ||
</button> | ||
<div className={`accordion-content ${activeIndex === index ? 'active' : ''}`}> | ||
<p>{faq.answer}</p> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
|
||
</div> | ||
|
||
); | ||
}; | ||
|
||
export default FAQs; |
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