diff --git a/pages/index.js b/pages/index.js index 1d443a0..4edde8f 100644 --- a/pages/index.js +++ b/pages/index.js @@ -8,7 +8,7 @@ import TwitchPopup from '../components/twitchpopup'; const client_id = "edpx4oisrkpnrlx47b7a2p3govy6qm"; const client_secret = "dqr2glvdhr7uyn3bf3biu48977rfwo"; -export default function Index({ motto, twitch_online }) { +export default function Index({ motto, twitch_online, about }) { return (
@@ -38,9 +38,7 @@ export default function Index({ motto, twitch_online }) {

About me

- I'm a gay femboy nurse fox who likes figure skating, running and dancing, - addicted to vr and video making and I'm always listening to music, - oh and I play dnd... And that's just about me in a nutshell. + {about}

@@ -59,6 +57,25 @@ export default function Index({ motto, twitch_online }) { ) } +async function getAboutText() { + const req = await fetch("https://api.airtable.com/v0/appQnOyKBnBVQXLUM/Locale", { + method: "GET", + headers: { + 'Content-Type': 'application/json', + "Authorization": "Bearer " + process.env.AIRTABLE, + } + }); + + const data = await req.json(); + for(const key in data['records']) { + if(data['records'][key]['fields']['field'] == "about") { + return data['records'][key]['fields']['value']; + } + }; + + return ""; +} + async function getMottos() { const req = await fetch("https://api.airtable.com/v0/appQnOyKBnBVQXLUM/Mottos", { method: "GET", @@ -118,7 +135,8 @@ export async function getServerSideProps() { return { props: { motto: await RandomMotto(), - twitch_online: await getIsUserLive() + twitch_online: await getIsUserLive(), + about: await getAboutText() } }; }