mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-21 12:00: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 sanity from '../sanity';
|
||||||
import { SanityDocument } from '@sanity/client/sanityClient';
|
import { SanityDocument } from '@sanity/client/sanityClient';
|
||||||
|
|
||||||
interface MissionDocument {
|
|
||||||
mission: string;
|
|
||||||
vision: string;
|
|
||||||
quote_text: string;
|
|
||||||
quote_author: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
function useMission() {
|
function useMission() {
|
||||||
let [mission, setMission] = React.useState<
|
let [mission, setMission] = React.useState<
|
||||||
SanityDocument<MissionDocument> | undefined
|
SanityDocument<SGA.MissionDocument> | undefined
|
||||||
>();
|
>();
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
sanity.getDocument<MissionDocument>('mission').then(setMission);
|
sanity.getDocument<SGA.MissionDocument>('mission').then(setMission);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return mission;
|
return mission;
|
||||||
|
|
10
src/index.d.ts
vendored
10
src/index.d.ts
vendored
|
@ -26,11 +26,19 @@ declare namespace SGA {
|
||||||
bio: string;
|
bio: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface MissionDocument {
|
||||||
|
mission: string;
|
||||||
|
vision: string;
|
||||||
|
inspiration: string;
|
||||||
|
quote_text: string;
|
||||||
|
quote_author: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface GetInvolvedWay {
|
interface GetInvolvedWay {
|
||||||
_id: string;
|
_id: string;
|
||||||
title: string;
|
title: string;
|
||||||
text: string;
|
text: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
interface GetInvolvedDocument {
|
interface GetInvolvedDocument {
|
||||||
ways: GetInvolvedWay[];
|
ways: GetInvolvedWay[];
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default function Mission() {
|
||||||
|
|
||||||
<ParagraphWithHeader title='Vision' body={mission.vision} />
|
<ParagraphWithHeader title='Vision' body={mission.vision} />
|
||||||
<ParagraphWithHeader title='Mission' body={mission.mission} />
|
<ParagraphWithHeader title='Mission' body={mission.mission} />
|
||||||
|
<ParagraphWithHeader title='Inspiration' body={mission.inspiration} />
|
||||||
|
|
||||||
<Centered>
|
<Centered>
|
||||||
<BlueButtonLink href={previousLeadershipLink}>
|
<BlueButtonLink href={previousLeadershipLink}>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user