From 4a7973fbf6c0c4bce47f65f3e77c2478752e6ea5 Mon Sep 17 00:00:00 2001 From: yudejp Date: Sun, 23 May 2021 14:02:27 +0900 Subject: [PATCH] Integrate footer component --- pages/components/Footer.js | 29 +++++++++++++++++++++++++++++ pages/components/Layout.js | 19 ++++--------------- pages/house.js | 2 -- pages/index.js | 2 -- pages/profile.js | 2 -- pages/status.js | 2 -- 6 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 pages/components/Footer.js diff --git a/pages/components/Footer.js b/pages/components/Footer.js new file mode 100644 index 0000000..e7a990d --- /dev/null +++ b/pages/components/Footer.js @@ -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 ( + <> +
+
+
+

+ {footer} / {source} +

+

+ {tos} +

+
+
+
+ + ); +} \ No newline at end of file diff --git a/pages/components/Layout.js b/pages/components/Layout.js index 58473e5..61b061b 100644 --- a/pages/components/Layout.js +++ b/pages/components/Layout.js @@ -1,10 +1,10 @@ import Head from "next/head" -import Link from "next/link" import "tailwindcss/tailwind.css"; import useTranslation from 'next-translate/useTranslation' import { useRouter } from 'next/router' import React, { useEffect, useState } from 'react' -import { useTheme } from "next-themes"; +import Footer from "./Footer" +import Navbar from "./Navbar" const Layout = (props) => { const { title, children } = props @@ -23,6 +23,7 @@ const Layout = (props) => {
+
{children}
@@ -31,20 +32,8 @@ const Layout = (props) => { body { text-align: center; } - `} -
-
-
-

- {footer} / {source} -

-

- {tos} -

-
-
-
+
) diff --git a/pages/house.js b/pages/house.js index 24ae0c5..dc4b51a 100644 --- a/pages/house.js +++ b/pages/house.js @@ -1,5 +1,4 @@ import Layout from "./components/Layout" -import Navbar from "./components/Navbar" import useTranslation from 'next-translate/useTranslation' import { useRouter } from 'next/router' @@ -13,7 +12,6 @@ export default function About(props) { return ( -

{house}

diff --git a/pages/index.js b/pages/index.js index 07cbc2c..ebbc906 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,5 +1,4 @@ import Layout from "./components/Layout" -import Navbar from "./components/Navbar" import Link from 'next/link' import { faDiscord, faGit, faMastodon, faGithub } from '@fortawesome/free-brands-svg-icons' import { faBlog, faBook, faUser, faServer, faHouseUser } from '@fortawesome/free-solid-svg-icons' @@ -19,7 +18,6 @@ export default function Index(props) { return ( -
-
{ diff --git a/pages/status.js b/pages/status.js index be03277..2b9bdd7 100644 --- a/pages/status.js +++ b/pages/status.js @@ -1,5 +1,4 @@ import Layout from "./components/Layout" -import Navbar from "./components/Navbar" import useTranslation from 'next-translate/useTranslation' import { useRouter } from 'next/router' @@ -17,7 +16,6 @@ export default function About(props) { return ( -
{ // Heading