2021-02-06 20:11:20 +09:00
|
|
|
import Head from "next/head"
|
|
|
|
import Link from "next/link"
|
|
|
|
import "tailwindcss/tailwind.css";
|
2021-02-08 16:05:44 +09:00
|
|
|
import useTranslation from 'next-translate/useTranslation'
|
|
|
|
import { useRouter } from 'next/router'
|
2021-02-06 20:11:20 +09:00
|
|
|
import React, { useEffect, useState } from 'react'
|
|
|
|
|
|
|
|
const Layout = (props) => {
|
|
|
|
const { title, children } = props
|
|
|
|
const siteTitle = "yude.jp"
|
2021-02-08 16:05:44 +09:00
|
|
|
const router = useRouter()
|
|
|
|
const { locale, locales, defaultLocale, pathname } = router
|
|
|
|
|
|
|
|
const { t, lang } = useTranslation("common")
|
|
|
|
const footer = t('footer')
|
|
|
|
const source = t('source')
|
2021-02-20 12:03:48 +09:00
|
|
|
const tos = t('tos')
|
2021-02-06 20:11:20 +09:00
|
|
|
return (
|
|
|
|
<div className="page">
|
|
|
|
<Head>
|
|
|
|
<title>{title ? `${title} - ${siteTitle}` : siteTitle}</title>
|
|
|
|
<link rel="icon" href="/static/images/favicon.ico" />
|
|
|
|
</Head>
|
2021-02-08 16:53:45 +09:00
|
|
|
<body className="min-h-screen bg-gray-900 text-white subpixel-antialiased">
|
2021-02-06 20:11:20 +09:00
|
|
|
<main>
|
|
|
|
<div className="page-main">
|
|
|
|
{children}
|
|
|
|
</div>
|
2021-02-06 21:28:29 +09:00
|
|
|
|
2021-02-06 20:11:20 +09:00
|
|
|
<style jsx global>{`
|
|
|
|
body {
|
|
|
|
text-align: center;
|
|
|
|
}
|
2021-02-06 21:28:29 +09:00
|
|
|
|
2021-02-06 20:11:20 +09:00
|
|
|
`}</style>
|
|
|
|
<div className="container mx-auto px-6">
|
2021-02-08 17:01:20 +09:00
|
|
|
<div className="mt-16 flex flex-col items-center">
|
2021-02-08 16:05:44 +09:00
|
|
|
<div className="sm:w-full text-center py-6">
|
|
|
|
<p className="text-sm font-bold mb-2 text-gray-400">
|
2021-02-08 17:22:31 +09:00
|
|
|
{footer} / <Link href="https://github.com/yudemoe/yude.jp"><a className="hover:underline">{source}</a></Link>
|
2021-02-06 20:11:20 +09:00
|
|
|
</p>
|
2021-02-20 12:03:48 +09:00
|
|
|
<p className="text-sm font-bold mb-2 text-gray-400">
|
|
|
|
<Link href="https://wiki.yude.jp/terms"><a className="hover:underline">{tos}</a></Link>
|
|
|
|
</p>
|
2021-02-06 20:11:20 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-06 21:28:29 +09:00
|
|
|
</main>
|
2021-02-06 20:11:20 +09:00
|
|
|
</body>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
export default Layout
|