2022-06-20 18:31:22 +02:00
|
|
|
import Page from 'site/components/wrappers/page.js'
|
|
|
|
import useApp from 'site/hooks/useApp.js'
|
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
|
|
|
import Layout from 'site/components/layouts/docs'
|
|
|
|
import { useTranslation } from 'next-i18next'
|
|
|
|
import FsIcon from 'shared/components/icons/freesewing'
|
|
|
|
import Link from 'next/link'
|
|
|
|
import Popout from 'shared/components/popout'
|
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
import themes from 'shared/themes/index.js'
|
|
|
|
|
|
|
|
const translations = {
|
|
|
|
sade: {
|
|
|
|
en: `Stand-alone development environment`,
|
|
|
|
nl: `Vrijstaande ontwikkeling omgeving`,
|
|
|
|
},
|
|
|
|
load: {
|
|
|
|
en: `To your design`,
|
|
|
|
nl: `Naar jouw ontwerp`,
|
|
|
|
},
|
|
|
|
tips: {
|
2022-10-06 14:15:13 +02:00
|
|
|
en: (
|
|
|
|
<Popout tip compact>
|
|
|
|
Edit the files in the <strong>design</strong> folder, and we'll auto-update your design
|
|
|
|
</Popout>
|
|
|
|
),
|
|
|
|
nl: (
|
|
|
|
<Popout tip compact>
|
|
|
|
Bewerk de bestanden in de <strong>design</strong> map, en we passen je ontwerp automatisch
|
|
|
|
aan
|
|
|
|
</Popout>
|
|
|
|
),
|
2022-06-20 18:31:22 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
const HomePage = (props) => {
|
|
|
|
const app = useApp()
|
|
|
|
const router = useRouter()
|
|
|
|
const { t } = useTranslation(['common', 'patrons', 'locales', 'themes'])
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Page app={app} title={false} layout={Layout}>
|
|
|
|
<div className="text-center w-full pt-20 pb-10 max-w-4xl m-auto">
|
|
|
|
<FsIcon className="w-96 m-auto" />
|
|
|
|
<h1>FreeSewing</h1>
|
|
|
|
<h4>{translations.sade[app.locale]}</h4>
|
2022-12-30 16:39:08 +01:00
|
|
|
<Link href="/design" className="btn btn-primary btn-lg h-20 my-8 mb-12">
|
|
|
|
<span role="image" className="text-4xl px-6">
|
|
|
|
👉
|
|
|
|
</span>
|
|
|
|
<span className="text-xl px-2">{translations.load[app.locale]}</span>
|
|
|
|
<span role="image" className="text-4xl px-6">
|
|
|
|
👈
|
|
|
|
</span>
|
2022-06-20 18:31:22 +02:00
|
|
|
</Link>
|
|
|
|
{translations.tips[app.locale]}
|
|
|
|
</div>
|
|
|
|
<div className="flex flex-row flex-wrap gap-4 w-full max-w-4xl m-auto justify-center">
|
2022-10-06 14:15:13 +02:00
|
|
|
{router.locales.map((locale) => (
|
2022-12-30 16:39:08 +01:00
|
|
|
<Link
|
|
|
|
href={router.asPath}
|
|
|
|
locale={locale}
|
|
|
|
key={locale}
|
|
|
|
className="btn btn-ghost text-base-content hover:bg-base-200"
|
|
|
|
>
|
|
|
|
<span className="text-base-content">{t(`locales:${locale}`)}</span>
|
2022-06-20 18:31:22 +02:00
|
|
|
</Link>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
<div className="flex flex-row flex-wrap gap-4 w-full max-w-4xl m-auto justify-center mt-4">
|
2022-10-06 14:15:13 +02:00
|
|
|
{Object.keys(themes).map((theme) => (
|
|
|
|
<button
|
|
|
|
key={theme}
|
|
|
|
onClick={() => app.setTheme(theme)}
|
|
|
|
className="btn btn-ghost hover:bg-base-200"
|
|
|
|
>
|
|
|
|
<span className="text-base-content">{t(`themes:${theme}Theme`)}</span>
|
|
|
|
</button>
|
|
|
|
))}
|
2022-06-20 18:31:22 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="py-20">
|
|
|
|
<h2>{t('patrons:supportFreesewing')}</h2>
|
|
|
|
<div className="flex flex-row flex-wrap gap-2">
|
|
|
|
<div>
|
2022-07-12 20:09:17 +02:00
|
|
|
<p className="max-w-3xl">{t('patrons:patronLead')}</p>
|
|
|
|
<p className="max-w-3xl">{t('patrons:patronPitch')}</p>
|
2022-06-20 18:31:22 +02:00
|
|
|
</div>
|
|
|
|
<a className="btn btn-accent btn-lg ">
|
2022-10-06 14:15:13 +02:00
|
|
|
<span role="image" className="text-4xl px-4">
|
|
|
|
🥰
|
|
|
|
</span>
|
2022-06-20 18:31:22 +02:00
|
|
|
<span className="px-2">{t('patrons:becomeAPatron')}</span>
|
2022-10-06 14:15:13 +02:00
|
|
|
<span role="image" className="text-4xl px-4">
|
|
|
|
🙏🏻
|
|
|
|
</span>
|
2022-06-20 18:31:22 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-23 13:13:56 +02:00
|
|
|
{/* here to force Tailwind inclusion of the w-8 h-8 classes */}
|
|
|
|
<span className="w-8 h-8" />
|
2022-06-20 18:31:22 +02:00
|
|
|
</Page>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default HomePage
|
|
|
|
|
|
|
|
export async function getStaticProps({ locale }) {
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
...(await serverSideTranslations(locale)),
|
2022-10-06 14:15:13 +02:00
|
|
|
},
|
2022-06-20 18:31:22 +02:00
|
|
|
}
|
|
|
|
}
|