1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

feat: display age nearby the birth date

This commit is contained in:
Divlo
2022-03-24 11:45:19 +01:00
parent 1152039663
commit a67d6665ea
13 changed files with 3273 additions and 4867 deletions

View File

@ -6,6 +6,7 @@ import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
interface Error404Props extends FooterProps {
description: string
@ -31,7 +32,8 @@ const Error404: NextPage<Error404Props> = (props) => {
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
const description = getDefaultDescription()
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description } }
}

View File

@ -6,6 +6,7 @@ import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
interface Error500Props extends FooterProps {
description: string
@ -31,7 +32,8 @@ const Error500: NextPage<Error500Props> = (props) => {
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
const description = getDefaultDescription()
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description } }
}

View File

@ -13,14 +13,16 @@ import { OpenSource } from 'components/OpenSource'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
import { DIVLO_BIRTHDAY, getAge } from 'utils/getAge'
interface HomeProps extends FooterProps {
description: string
age: number
}
const Home: NextPage<HomeProps> = (props) => {
const { t } = useTranslation()
const { version, description } = props
const { version, description, age } = props
return (
<>
@ -29,7 +31,7 @@ const Home: NextPage<HomeProps> = (props) => {
<Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
<Section isMain id='about'>
<Profile />
<Profile age={age} />
<SocialMediaList />
</Section>
@ -74,11 +76,12 @@ const Home: NextPage<HomeProps> = (props) => {
)
}
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
export const getStaticProps: GetStaticProps<HomeProps> = async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
const description = getDefaultDescription()
return { props: { version, description } }
const age = getAge(DIVLO_BIRTHDAY)
const description = getDefaultDescription(age)
return { props: { version, description, age } }
}
export default Home