Skip to content

Commit

Permalink
refactor: convert components to arrow functions and reexport
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderl19 committed Nov 3, 2023
1 parent b8e25c9 commit d379f4e
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 28 deletions.
26 changes: 12 additions & 14 deletions apps/site/src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
export const revalidate = 60;

import Landing from "./sections/Landing/Landing";
import Intro from "./sections/Intro/Intro";
import Mentor from "./sections/Mentor/Mentor";
import Sponsors from "./sections/Sponsors/Sponsors";
import FAQ from "./sections/FAQ/FAQ";
import Landing from "./sections/Landing";
import Intro from "./sections/Intro";
import Mentor from "./sections/Mentor";
import Sponsors from "./sections/Sponsors";
import FAQ from "./sections/FAQ";

import styles from "./page.module.scss";

const Home = () => {
return (
<>
<div className={styles.home}>
<Landing />
<Intro />
<Mentor />
<Sponsors />
<FAQ />
</div>
</>
<div className={styles.home}>
<Landing />
<Intro />
<Mentor />
<Sponsors />
<FAQ />
</div>
);
};

Expand Down
6 changes: 4 additions & 2 deletions apps/site/src/app/(home)/sections/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import styles from "./FAQ.module.scss";
import star from "@/assets/images/star.png";
import eraser from "@/assets/images/eraser.png";

export default async function FAQ() {
const FAQ = async () => {
const questions = await getQuestions();
const faq = questions[0]["faqs"].map(({ _key, question, answer }) => ({
_key: _key,
Expand All @@ -28,4 +28,6 @@ export default async function FAQ() {
</div>
</section>
);
}
};

export default FAQ;
6 changes: 4 additions & 2 deletions apps/site/src/app/(home)/sections/FAQ/FAQAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface FAQAccordion {
}[];
}

export default function FAQAccordion({ faq }: FAQAccordion) {
const FAQAccordion: React.FC<FAQAccordion> = ({ faq }) => {
return (
<Accordion className={styles.accordion} alwaysOpen>
{faq.map(({ _key, question, answer }) => (
Expand All @@ -28,4 +28,6 @@ export default function FAQAccordion({ faq }: FAQAccordion) {
))}
</Accordion>
);
}
};

export default FAQAccordion;
1 change: 1 addition & 0 deletions apps/site/src/app/(home)/sections/FAQ/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./FAQ";
6 changes: 4 additions & 2 deletions apps/site/src/app/(home)/sections/Intro/Intro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hackDoodle from "@/assets/images/hack-doodle.png";

import styles from "./Intro.module.scss";

export default function Intro() {
const Intro = () => {
return (
<Container as="section">
<div className={styles.intro}>
Expand Down Expand Up @@ -37,4 +37,6 @@ export default function Intro() {
</div>
</Container>
);
}
};

export default Intro;
1 change: 1 addition & 0 deletions apps/site/src/app/(home)/sections/Intro/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Intro";
6 changes: 4 additions & 2 deletions apps/site/src/app/(home)/sections/Landing/ApplyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HackSticker, HeartSticker } from "@/components/Sticker/Stickers";

import styles from "./ApplyButton.module.scss";

export default function ApplyButton() {
const ApplyButton = () => {
return (
<StickerPosition
stickers={[
Expand All @@ -28,4 +28,6 @@ export default function ApplyButton() {
</Button>
</StickerPosition>
);
}
};

export default ApplyButton;
4 changes: 2 additions & 2 deletions apps/site/src/app/(home)/sections/Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import ApplyButton from "./ApplyButton";

import styles from "./Landing.module.scss";

function Landing() {
const Landing = () => {
return (
<div className={styles.landing}>
<h1>ZotHacks 2023</h1>
<p className="fs-2">November 4&ndash;5</p>
<ApplyButton />
</div>
);
}
};

export default Landing;
1 change: 1 addition & 0 deletions apps/site/src/app/(home)/sections/Landing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Landing";
6 changes: 4 additions & 2 deletions apps/site/src/app/(home)/sections/Mentor/Mentor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import styles from "./Mentor.module.scss";

const MENTOR_APP_URL = "/mentor";

export default function Mentor() {
const Mentor = () => {
const mentorHeader = (
<h2 className="mb-3 text-start">Interested in becoming a mentor?</h2>
);
Expand Down Expand Up @@ -51,4 +51,6 @@ export default function Mentor() {
</div>
</Container>
);
}
};

export default Mentor;
1 change: 1 addition & 0 deletions apps/site/src/app/(home)/sections/Mentor/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Mentor";
6 changes: 4 additions & 2 deletions apps/site/src/app/(home)/sections/Sponsors/Sponsors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import clip from "./clip.svg";

const builder = imageUrlBuilder(client);

export default async function Sponsors() {
const Sponsors = async () => {
const sponsors = await getSponsors();

return (
Expand All @@ -29,4 +29,6 @@ export default async function Sponsors() {
</div>
</section>
);
}
};

export default Sponsors;
1 change: 1 addition & 0 deletions apps/site/src/app/(home)/sections/Sponsors/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Sponsors";

0 comments on commit d379f4e

Please sign in to comment.