diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 87ea131..06487a9 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,10 +1,8 @@ -import React from 'react'; - -const NotFoundPage = () => ( -
-

404: Not Found

-

This page wasn't found...

-
-); - -export default NotFoundPage; +export default function NotFoundPage() { + return ( +
+

404: Not Found

+

This page wasn't found...

+
+ ); +} diff --git a/src/pages/classcouncil.tsx b/src/pages/classcouncil.tsx index cd907ed..2e37cbd 100644 --- a/src/pages/classcouncil.tsx +++ b/src/pages/classcouncil.tsx @@ -8,16 +8,13 @@ export default function ClassCouncil() { `*[_type == 'member' && role == 'class'] | order (year desc)` ); - if (!members) { - return null; - } - return ( <> - {members.map((member) => { - return ; - })} + {members && + members.map((member) => { + return ; + })} ); } diff --git a/src/pages/committee.tsx b/src/pages/committee.tsx index ff6ddef..d1f8ac2 100644 --- a/src/pages/committee.tsx +++ b/src/pages/committee.tsx @@ -9,17 +9,14 @@ export default function Committee() { ); // year desc because seniority 8) - if (!excomm) { - return null; - } - return ( <>
- {excomm.map((member) => { - return ; - })} + {excomm && + excomm.map((member) => { + return ; + })}
); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index baff9dc..99424c8 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,7 +3,7 @@ import Hero from '../components/Hero'; import NewsAndMission from '../components/NewsAndMission'; import SegmentGroup from '../components/SegmentGroup'; -const IndexPage = () => { +export default function IndexPage() { return ( <> {/* Hero image */} @@ -20,6 +20,4 @@ const IndexPage = () => { ); -}; - -export default IndexPage; +} diff --git a/src/pages/initiatives.tsx b/src/pages/initiatives.tsx index cbe0ae3..6f5a478 100644 --- a/src/pages/initiatives.tsx +++ b/src/pages/initiatives.tsx @@ -8,15 +8,11 @@ export default function Initiatives() { '*[_type == "initiative"]' ); - if (!initiatives) { - return null; - } - return ( <>
- {initiatives.map((initiative) => { + {initiatives && initiatives.map((initiative) => { return ; })}
diff --git a/src/pages/mission.tsx b/src/pages/mission.tsx index 2d82a79..4525e5f 100644 --- a/src/pages/mission.tsx +++ b/src/pages/mission.tsx @@ -6,46 +6,46 @@ import '../css/mission.css'; export default function Mission() { let mission = useMission(); - if (!mission) { - return null; - } - return ( <> -
-
- “{mission.quote_text}” -
-
- — {mission.quote_author} -
-
-
- Vision + {mission ? ( +
+
+ “{mission.quote_text}” +
+
+ + — {mission.quote_author} +
-
-

{mission.vision}

+
+
+ Vision +
+
+

{mission.vision}

+
+
+
+
+
+ Mission +
+
+

{mission.mission}

+
+
+
-
-
-
- Mission -
-
-

{mission.mission}

-
-
- -
+ ) : null} ); } diff --git a/src/pages/officers.tsx b/src/pages/officers.tsx index 1a66575..f42d901 100644 --- a/src/pages/officers.tsx +++ b/src/pages/officers.tsx @@ -16,9 +16,11 @@ export default function Officers() { <>
- {officers.map((officer) => { - return ; - })} + {officers + ? officers.map((officer) => { + return ; + }) + : null}
);