0
0
mirror of https://github.com/yude-jp/yude.jp synced 2025-10-14 04:08:36 +09:00
This commit is contained in:
2021-12-11 18:07:22 +09:00
parent c856a34867
commit d9559dd072
46 changed files with 218 additions and 300 deletions

View File

@@ -4,9 +4,6 @@ import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router'
function App (){
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const { t, lang } = useTranslation("common")
const [data, setData] = useState({ hits: [] });
useEffect(() => {
const fetchData = async () => {

View File

@@ -1,13 +1,9 @@
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")
// i18n
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
export default function Footer(props) {
return (
<>
<div className="container mx-auto px-6">

View File

@@ -6,9 +6,6 @@ import { faLanguage } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
const Dropdown = ({ color }) => {
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
// dropdown props
const [dropdownPopoverShow, setDropdownPopoverShow] = React.useState(false);
const btnDropdownRef = React.createRef();

View File

@@ -1,21 +1,19 @@
// Next.js
import Head from "next/head"
// Tailwind CSS
import "tailwindcss/tailwind.css";
import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router'
// React
import React, { useEffect, useState } from 'react'
// Components
import Footer from "./Footer/Footer"
import Navbar from "./Navbar"
const Layout = (props) => {
const { title, children } = props
const siteTitle = "yude.jp"
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="page">
<Head>

View File

@@ -6,10 +6,6 @@ import Image from 'next/image'
import { list } from 'postcss';
export default function Minecraft(props) {
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const { t, lang } = useTranslation("minecraft")
const [data, setData] = useState({ hits: [] });
useEffect(() => {

View File

@@ -6,9 +6,6 @@ import LastPlayed from './LastPlayed'
function App (props) {
const uuid = props;
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const { t, lang } = useTranslation("common")
const [data, setData] = useState({ hits: [] });
useEffect(() => {

View File

@@ -16,7 +16,8 @@ const Navbar = () => {
</Link>
<div className="absolute right-0">
<ThemeSelector />
<LangSelector />
{/* <LangSelector /> */}
<LanguageSwitcher lang="ja" />
</div>
</nav>
</>

View File

@@ -8,8 +8,6 @@ import Link from 'next/link'
export default function Modal() {
const [showModal, setShowModal] = React.useState(false);
const router = useRouter()
const { t, lang } = useTranslation("common")
const { locale, locales, defaultLocale, pathname } = router
const close = t('common:close')
const keys = t('profile:keys')
const view = t('profile:view')

View File

@@ -4,9 +4,6 @@ import useTranslation from 'next-translate/useTranslation'
import { useRouter } from 'next/router'
function App () {
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const { t, lang } = useTranslation("common")
const [data, setData] = useState({ hits: [] });
useEffect(() => {
const fetchData = async () => {

View File

@@ -6,10 +6,7 @@ import { useRouter } from 'next/router'
export default function Modal() {
const [showModal, setShowModal] = React.useState(false);
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const { t, lang } = useTranslation("common")
const close = t('common:close')
return (
<>
<button

View File

@@ -7,9 +7,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
const ThemeSelector = (props) => {
const { title, children } = props
const router = useRouter()
const { locale, locales, defaultLocale, pathname } = router
const [isMounted, setIsMounted] = useState(false);
const { theme, setTheme, getTheme } = useTheme();
useEffect(() => {