diff --git a/.github/workflows/website-check.yaml b/.github/workflows/website-check.yaml index 0303910..3f94144 100644 --- a/.github/workflows/website-check.yaml +++ b/.github/workflows/website-check.yaml @@ -20,11 +20,19 @@ jobs: node-version: 20.x cache: "npm" + - name: Cache Dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ github.event.pull_request.number }}- + - name: Install Dependencies run: npm ci - - name: Run lint + - name: Lint run: npm run lint - - name: Run format check + - name: Format run: npx prettier --check . diff --git a/src/app/(site)/_components/faq.tsx b/src/app/(site)/_components/faq.tsx deleted file mode 100644 index 0360bbe..0000000 --- a/src/app/(site)/_components/faq.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { FAQType } from "@/types/interface"; -import React, { useEffect, useState } from "react"; -import { FaChevronDown } from "react-icons/fa"; - -interface FAQProps { - faqs: FAQType[]; -} - -interface FAQDropDownProps { - question: string; - answer: string; -} - -export const FAQDropDown: React.FC = (props) => { - const { question, answer } = props; - const [opened, setOpen] = useState(false); - const [mounted, setMounted] = useState(false); - - useEffect(() => { - setMounted(true); - }, []); - - const toggleOpen = () => { - setOpen(!opened); - }; - return ( - - -
-

- {question} -

-
- -
-
-
-

{answer}

-
-
- ); -}; - -const FAQ: React.FC = (props) => { - const { faqs } = props; - return ( - <> - -

- FAQ -

-
- {faqs.map((faq: FAQType) => { - return ( -
- -
- ); - })} -
-

- More questions? Reach out to us at - - {" fullyhacks@gmail.com "} - - and we'll get back to you ASAP! -

- - ); -}; - -export default FAQ; diff --git a/src/app/(site)/_components/landing-page.tsx b/src/app/(site)/_components/landing-page.tsx index 5e5321d..0752ce3 100644 --- a/src/app/(site)/_components/landing-page.tsx +++ b/src/app/(site)/_components/landing-page.tsx @@ -11,7 +11,7 @@ import CountDown from "./count-down"; import About from "./about"; import Sponsors from "./sponsors"; import Partners from "./partners"; -import FAQ from "./faq"; +import FAQ from "@/components/faq"; import Team from "./team"; interface LandingPageProps { diff --git a/src/app/(site)/admin/_components/applications.tsx b/src/app/(site)/admin/_components/applications.tsx index f0ba48a..2fc59e4 100644 --- a/src/app/(site)/admin/_components/applications.tsx +++ b/src/app/(site)/admin/_components/applications.tsx @@ -18,18 +18,18 @@ const Applications: React.FC = (props) => { const handleStatusChange = (event: React.ChangeEvent) => { setStatusFilter(event.target.value); }; - // Filter out application when choose from the Filter by: dropdown - const getFilteredApplication = ( - applications: ApplicationType[], - statusFilter: string - ) => { - return statusFilter === "all" - ? applications.filter((app) => !applicationIdx.includes(app.id)) - : applications.filter((app) => app.status === statusFilter); - }; const filteredApplications = useMemo(() => { + // Filter out application when choose from the Filter by: dropdown + const getFilteredApplication = ( + applications: ApplicationType[], + statusFilter: string + ) => { + return statusFilter === "all" + ? applications.filter((app) => !applicationIdx.includes(app.id)) + : applications.filter((app) => app.status === statusFilter); + }; return getFilteredApplication(applications, statusFilter); - }, [applications, statusFilter, getFilteredApplication]); + }, [applications, statusFilter, applicationIdx]); const applicationsNumber = filteredApplications.length; type GroupedData = Record; const classStat: [] = []; diff --git a/src/app/(site)/apply/_components/application-form.tsx b/src/app/(site)/apply/_components/application-form.tsx index cf629eb..77796a6 100644 --- a/src/app/(site)/apply/_components/application-form.tsx +++ b/src/app/(site)/apply/_components/application-form.tsx @@ -190,7 +190,7 @@ const ApplicationForm: React.FC = (props) => { } } getGithubLogin(); - }, []); + }, [userId]); const onSubmit = async () => { try { @@ -474,8 +474,8 @@ const ApplicationForm: React.FC = (props) => { February 24th, 2024.{" "}

- We will be checking School ID. If you are a minor, you won't be - allowed to attend. + We will be checking School ID. If you are a minor, you won't + be allowed to attend.

diff --git a/src/app/(site)/feed/_components/events.tsx b/src/app/(site)/feed/_components/events.tsx index ee4d295..b6f4212 100644 --- a/src/app/(site)/feed/_components/events.tsx +++ b/src/app/(site)/feed/_components/events.tsx @@ -305,7 +305,9 @@ const Events: React.FC = () => {
{filteredEvent.map((event: eventsType) => { return ( -
+

{event.name}

= (props) => { <> Cat Icon