mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-09 22:50:17 -04:00
Add 'Inspiration' section to mission
This commit is contained in:
parent
1383f2d213
commit
2ef9c7ef46
|
@ -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<MissionDocument> | undefined
|
||||
SanityDocument<SGA.MissionDocument> | undefined
|
||||
>();
|
||||
|
||||
React.useEffect(() => {
|
||||
sanity.getDocument<MissionDocument>('mission').then(setMission);
|
||||
sanity.getDocument<SGA.MissionDocument>('mission').then(setMission);
|
||||
}, []);
|
||||
|
||||
return mission;
|
||||
|
|
10
src/index.d.ts
vendored
10
src/index.d.ts
vendored
|
@ -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[];
|
||||
|
|
|
@ -35,6 +35,7 @@ export default function Mission() {
|
|||
|
||||
<ParagraphWithHeader title='Vision' body={mission.vision} />
|
||||
<ParagraphWithHeader title='Mission' body={mission.mission} />
|
||||
<ParagraphWithHeader title='Inspiration' body={mission.inspiration} />
|
||||
|
||||
<Centered>
|
||||
<BlueButtonLink href={previousLeadershipLink}>
|
||||
|
|
Loading…
Reference in New Issue
Block a user