0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-11-05 01:48:01 +09:00

Integrate footer component

This commit is contained in:
yude 2021-05-23 14:02:27 +09:00
parent 9130e072df
commit 4a7973fbf6
Signed by: yude
GPG Key ID: EB0FE5D925C4A968
6 changed files with 33 additions and 23 deletions

View File

@ -0,0 +1,29 @@
import "tailwindcss/tailwind.css";
import Link from 'next/link';
import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router'
export default function Footer(props) {
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const { t, lang } = useTranslation("common")
const footer = t('footer')
const source = t('source')
const tos = t('tos')
return (
<>
<div className="container mx-auto px-6">
<div className="mt-16 flex flex-col items-center">
<div className="sm:w-full text-center py-6">
<p className="text-sm font-bold mb-2">
{footer} / <Link href="https://github.com/yudejp/yude. jp"><a className="hover:underline">{source}</a></Link>
</p>
<p className="text-sm font-bold mb-2">
<Link href="https://scrapbox.io/yude/yude. jp_%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E5%88%A9%E7%94%A8%E8 %A6%8F%E7%B4%84"><a className="hover:underline">{tos}</a></Link>
</p>
</div>
</div>
</div>
</>
);
}

View File

@ -1,10 +1,10 @@
import Head from "next/head" import Head from "next/head"
import Link from "next/link"
import "tailwindcss/tailwind.css"; import "tailwindcss/tailwind.css";
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { useTheme } from "next-themes"; import Footer from "./Footer"
import Navbar from "./Navbar"
const Layout = (props) => { const Layout = (props) => {
const { title, children } = props const { title, children } = props
@ -23,6 +23,7 @@ const Layout = (props) => {
<link rel="icon" href="/static/images/favicon.ico" /> <link rel="icon" href="/static/images/favicon.ico" />
</Head> </Head>
<main> <main>
<Navbar />
<div className="page-main"> <div className="page-main">
{children} {children}
</div> </div>
@ -31,20 +32,8 @@ const Layout = (props) => {
body { body {
text-align: center; text-align: center;
} }
`}</style> `}</style>
<div className="container mx-auto px-6"> <Footer />
<div className="mt-16 flex flex-col items-center">
<div className="sm:w-full text-center py-6">
<p className="text-sm font-bold mb-2">
{footer} / <Link href="https://github.com/yudejp/yude.jp"><a className="hover:underline">{source}</a></Link>
</p>
<p className="text-sm font-bold mb-2">
<Link href="https://scrapbox.io/yude/yude.jp_%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E5%88%A9%E7%94%A8%E8%A6%8F%E7%B4%84"><a className="hover:underline">{tos}</a></Link>
</p>
</div>
</div>
</div>
</main> </main>
</div> </div>
) )

View File

@ -1,5 +1,4 @@
import Layout from "./components/Layout" import Layout from "./components/Layout"
import Navbar from "./components/Navbar"
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
@ -13,7 +12,6 @@ export default function About(props) {
return ( return (
<Layout title={house}> <Layout title={house}>
<Navbar />
<p className="my-2 text-3xl">{house}</p> <p className="my-2 text-3xl">{house}</p>
<div className="mx-9"> <div className="mx-9">
<iframe className="w-full h-96" src="https://mackerel.io/embed/public/embed/4mVIU29WCRVZgHUxQPzWsfXo953uxiAegbjDb83hTQ7szesCunwdpVkBIzhnLc9i?period=1d" frameborder="0" scrolling="no"></iframe> <iframe className="w-full h-96" src="https://mackerel.io/embed/public/embed/4mVIU29WCRVZgHUxQPzWsfXo953uxiAegbjDb83hTQ7szesCunwdpVkBIzhnLc9i?period=1d" frameborder="0" scrolling="no"></iframe>

View File

@ -1,5 +1,4 @@
import Layout from "./components/Layout" import Layout from "./components/Layout"
import Navbar from "./components/Navbar"
import Link from 'next/link' import Link from 'next/link'
import { faDiscord, faGit, faMastodon, faGithub } from '@fortawesome/free-brands-svg-icons' import { faDiscord, faGit, faMastodon, faGithub } from '@fortawesome/free-brands-svg-icons'
import { faBlog, faBook, faUser, faServer, faHouseUser } from '@fortawesome/free-solid-svg-icons' import { faBlog, faBook, faUser, faServer, faHouseUser } from '@fortawesome/free-solid-svg-icons'
@ -19,7 +18,6 @@ export default function Index(props) {
return ( return (
<Layout title={home}> <Layout title={home}>
<Navbar />
<div className="my-9"> <div className="my-9">
<div className="m-10"> <div className="m-10">
<Image <Image

View File

@ -1,5 +1,4 @@
import Layout from "./components/Layout" import Layout from "./components/Layout"
import Navbar from "./components/Navbar"
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import { faDiscord, faTwitter, faGithub, faKeybase, faInstagram, faMastodon, faSteam } from '@fortawesome/free-brands-svg-icons' import { faDiscord, faTwitter, faGithub, faKeybase, faInstagram, faMastodon, faSteam } from '@fortawesome/free-brands-svg-icons'
import { faEnvelope, faBirthdayCake, faMapPin, faSchool, faPhone, faInfo, faKey, faDownload, faEye } from '@fortawesome/free-solid-svg-icons' import { faEnvelope, faBirthdayCake, faMapPin, faSchool, faPhone, faInfo, faKey, faDownload, faEye } from '@fortawesome/free-solid-svg-icons'
@ -34,7 +33,6 @@ export default function About(props) {
return ( return (
<Layout title={about}> <Layout title={about}>
<Navbar />
<div className="my-9 mx-8"> <div className="my-9 mx-8">
{ {

View File

@ -1,5 +1,4 @@
import Layout from "./components/Layout" import Layout from "./components/Layout"
import Navbar from "./components/Navbar"
import useTranslation from 'next-translate/useTranslation' import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
@ -17,7 +16,6 @@ export default function About(props) {
return ( return (
<Layout title={status}> <Layout title={status}>
<Navbar />
<div className="my-9 mx-9"> <div className="my-9 mx-9">
{ {
// Heading // Heading