Skip to content

Commit

Permalink
Merge pull request #407 from vansh-codes/main
Browse files Browse the repository at this point in the history
[BUG] Fixes FAQ Page dark mode issue after refreshing
  • Loading branch information
MastanSayyad committed Sep 14, 2024
2 parents bd4f38c + 52f3f91 commit 3f24b53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions components/diabloAccordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ import {
AccordionPanel,
AccordionIcon,
} from "@chakra-ui/react";
import React from "react";
import React, {useState, useEffect} from "react";
import { useTheme } from "next-themes";
import { FaQuestionCircle } from "react-icons/fa";

const DiabloAccordion = ({ question, answer }) => {
const { theme } = useTheme();
const isDarkMode = theme === "dark";
const { theme, resolvedTheme } = useTheme();
const [mounted, setMounted] = useState(false);

useEffect(() => {
setMounted(true);
}, []);

const isDarkMode = resolvedTheme === "dark";
if (!mounted) return null;

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions pages/faq.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ function Faq() {
<meta name="description" content="FAQs of GirlScript Summer of Code" />
</Head>
<>
<div className="flex flex-row dark:text-white font-sans text-3xl md:text-5xl text-center font-extrabold flex-wrap justify-center items-center">
<div className="flex flex-row mt-4 dark:text-white font-sans text-3xl md:text-5xl text-center font-extrabold flex-wrap justify-center items-center">
<h1 className=" underline">
<span style={{ color:'#f97316' }}>Frequently Asked Questions</span>
</h1>
<h1 className="">(FAQs)</h1>
</div>


<div className="flex flex-col w-full justify-center px-16 mt-20 mb-10">
<div className="flex flex-col w-full justify-center px-16 mt-16 mb-10">
{data.map((curElem) => (
<DiabloAccordion key={curElem.id} {...curElem} />
))}
Expand Down

0 comments on commit 3f24b53

Please sign in to comment.