From 2ef9c7ef46549a8fd030b9943eb84e4811f21545 Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Tue, 5 Jan 2021 23:44:28 -0500 Subject: [PATCH] Add 'Inspiration' section to mission --- src/hooks/useMission.tsx | 11 ++--------- src/index.d.ts | 10 +++++++++- src/pages/mission.tsx | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/hooks/useMission.tsx b/src/hooks/useMission.tsx index 6db9f98..4f4b258 100644 --- a/src/hooks/useMission.tsx +++ b/src/hooks/useMission.tsx @@ -2,20 +2,13 @@ import React from 'react'; import sanity from '../sanity'; import { SanityDocument } from '@sanity/client/sanityClient'; -interface MissionDocument { - mission: string; - vision: string; - quote_text: string; - quote_author: string; -} - function useMission() { let [mission, setMission] = React.useState< - SanityDocument | undefined + SanityDocument | undefined >(); React.useEffect(() => { - sanity.getDocument('mission').then(setMission); + sanity.getDocument('mission').then(setMission); }, []); return mission; diff --git a/src/index.d.ts b/src/index.d.ts index 93cfc80..b1ed727 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -26,11 +26,19 @@ declare namespace SGA { bio: string; } + interface MissionDocument { + mission: string; + vision: string; + inspiration: string; + quote_text: string; + quote_author: string; + } + interface GetInvolvedWay { _id: string; title: string; text: string; - }; + } interface GetInvolvedDocument { ways: GetInvolvedWay[]; diff --git a/src/pages/mission.tsx b/src/pages/mission.tsx index ce0ce00..e93b7a5 100644 --- a/src/pages/mission.tsx +++ b/src/pages/mission.tsx @@ -35,6 +35,7 @@ export default function Mission() { +