0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-11-01 07:58:01 +09:00
yude.jp/pages/tos.js

40 lines
978 B
JavaScript
Raw Permalink Normal View History

2021-12-11 18:07:22 +09:00
// Base layout
2021-05-23 16:02:08 +09:00
import Layout from "./components/Layout"
2021-12-11 18:07:22 +09:00
// i18n
import { useTranslation, useLanguageQuery, LanguageSwitcher } from 'next-export-i18n';
// Next.js, React
2021-05-23 16:02:08 +09:00
import { useRouter } from 'next/router'
import React from "react"
2021-12-11 18:07:22 +09:00
// React Markdown
2021-05-23 16:02:08 +09:00
import ReactMarkdown from "react-markdown"
import gfm from 'remark-gfm';
2021-05-27 10:26:11 +09:00
import ja from '../docs/tos/ja.md'
import en from '../docs/tos/en.md'
2021-05-23 16:02:08 +09:00
export default function Tos(props) {
2021-12-11 18:55:57 +09:00
const { t } = useTranslation();
const [query] = useLanguageQuery();
2021-12-11 19:07:11 +09:00
if (!query) {
return <p>Loading...</p>
} else {
return (
<Layout title={t('tos')}>
<div>
{query["lang"] === 'ja' ? (
<ReactMarkdown plugins={[gfm]}>
{ja}
</ReactMarkdown>
) : (
<ReactMarkdown plugins={[gfm]}>
{en}
</ReactMarkdown>
)}
</div>
</Layout>
)
}
}