0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-11-02 00:18:00 +09:00
yude.jp/pages/components/Layout.js

37 lines
1014 B
JavaScript
Raw Normal View History

2021-02-06 20:11:20 +09:00
import Head from "next/head"
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'
2021-08-09 10:59:39 +09:00
import Footer from "./Footer/Footer"
2021-05-23 14:02:27 +09:00
import Navbar from "./Navbar"
2021-02-06 20:11:20 +09:00
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="/images/favicon.ico" />
2021-02-06 20:11:20 +09:00
</Head>
<main>
2021-05-23 14:02:27 +09:00
<Navbar />
2021-05-28 07:27:11 +09:00
<div className="max-w-2xl mx-auto">
2021-05-30 10:36:03 +09:00
<div className="mx-2">
2021-02-06 20:11:20 +09:00
{children}
2021-05-30 10:36:03 +09:00
</div>
2021-02-06 20:11:20 +09:00
</div>
2021-05-23 14:02:27 +09:00
<Footer />
2021-02-06 21:28:29 +09:00
</main>
2021-02-06 20:11:20 +09:00
</div>
)
}
export default Layout