1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-05 04:51:30 +01:00
.profile/pages/index.tsx

88 lines
2.4 KiB
TypeScript
Raw Normal View History

2021-12-04 15:52:51 +01:00
import { GetStaticProps, NextPage } from 'next'
2021-04-18 01:56:23 +02:00
import useTranslation from 'next-translate/useTranslation'
import { RevealFade } from 'components/design/RevealFade'
import { Section } from 'components/design/Section'
2021-04-18 23:09:51 +02:00
import { Head } from 'components/Head'
2021-04-18 01:56:23 +02:00
import { Interests } from 'components/Interests'
import { Portfolio } from 'components/Portfolio'
import { Profile } from 'components/Profile'
import { SocialMediaList } from 'components/Profile/SocialMediaList'
import { Skills } from 'components/Skills'
2021-07-04 19:56:05 +02:00
import { OpenSource } from 'components/OpenSource'
2021-07-27 13:36:35 +02:00
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
2021-12-04 15:52:51 +01:00
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
2021-04-18 01:56:23 +02:00
2021-12-04 15:52:51 +01:00
interface HomeProps extends FooterProps {
description: string
age: number
2021-12-04 15:52:51 +01:00
}
const Home: NextPage<HomeProps> = (props) => {
2021-04-18 01:56:23 +02:00
const { t } = useTranslation()
const { version, description, age } = props
2021-04-18 01:56:23 +02:00
return (
<>
2021-12-04 15:52:51 +01:00
<Head description={description} />
2021-04-18 01:56:23 +02:00
2021-11-08 15:10:26 +01:00
<Header showLanguage />
2021-07-27 13:36:35 +02:00
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<Section isMain id='about'>
<Profile age={age} />
2021-07-27 13:36:35 +02:00
<SocialMediaList />
2021-04-18 01:56:23 +02:00
</Section>
2021-07-27 13:36:35 +02:00
<RevealFade>
<Section id='interests' heading={t('home:interests.title')}>
<Interests />
</Section>
</RevealFade>
2021-04-18 01:56:23 +02:00
2021-07-27 13:36:35 +02:00
<RevealFade>
<Section
id='skills'
heading={t('home:skills.title')}
withoutShadowContainer
>
<Skills />
</Section>
</RevealFade>
2021-07-04 19:56:05 +02:00
2021-07-27 13:36:35 +02:00
<RevealFade>
<Section
id='portfolio'
heading={t('home:portfolio.title')}
withoutShadowContainer
>
<Portfolio />
</Section>
</RevealFade>
<RevealFade>
<Section
id='open-source'
heading='Open source'
withoutShadowContainer
>
<OpenSource />
</Section>
</RevealFade>
</main>
<Footer version={version} />
2021-04-18 01:56:23 +02:00
</>
)
}
export const getStaticProps: GetStaticProps<HomeProps> = async () => {
2021-08-16 15:31:35 +02:00
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description, age } }
2021-04-18 01:56:23 +02:00
}
export default Home