summaryrefslogtreecommitdiffstats
path: root/src/pages/cv.tsx
blob: 150e29a8b8b285f2770f73e0c7889426ec98b705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import Layout from '@components/Layouts/Layout';
import { seo } from '@config/seo';
import { getPageByUri } from '@services/graphql/queries';
import { NextPageWithLayout } from '@ts/types/app';
import { PageProps } from '@ts/types/pages';
import { loadTranslation } from '@utils/helpers/i18n';
import { GetStaticProps, GetStaticPropsContext } from 'next';
import Head from 'next/head';
import { ReactElement } from 'react';

const CV: NextPageWithLayout<PageProps> = ({ page }) => {
  return (
    <>
      <Head>
        <title>{seo.cv.title}</title>
        <meta name="description" content={seo.cv.description} />
      </Head>
      <article>
        <header>
          <h1>{page.title}</h1>
          <div dangerouslySetInnerHTML={{ __html: page.intro }}></div>
        </header>
        <div dangerouslySetInnerHTML={{ __html: page.content }}></div>
      </article>
    </>
  );
};

CV.getLayout = (page: ReactElement) => <Layout>{page}</Layout>;

export const getStaticProps: GetStaticProps = async (
  context: GetStaticPropsContext
) => {
  const translation = await loadTranslation(
    context.locale!,
    process.env.NODE_ENV === 'production'
  );
  const page = await getPageByUri('/cv/');

  return {
    props: {
      page,
      translation,
    },
  };
};

export default CV;