From a0d589fa16760ea44cccea0bef6190401600ff8e Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 16 Mar 2023 23:14:23 +0900 Subject: [PATCH] fix: replace to new link behavior (#1720) --- .eslintignore | 12 ++-- .gitignore | 10 +-- README.md | 26 -------- components/footer.tsx | 18 ++---- components/header.tsx | 14 ++-- next-env.d.ts | 5 -- pages/index.tsx | 147 +++++++++++++++++++++--------------------- pages/s/[slug].tsx | 39 ++++++----- 8 files changed, 114 insertions(+), 157 deletions(-) delete mode 100644 next-env.d.ts diff --git a/.eslintignore b/.eslintignore index f7182818..c87c9b39 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,8 +4,6 @@ /node_modules /.pnp .pnp.js -package.json -yarn.lock # testing /coverage @@ -25,12 +23,14 @@ yarn.lock npm-debug.log* yarn-debug.log* yarn-error.log* +.pnpm-debug.log* # local env files -.env.local -.env.development.local -.env.test.local -.env.production.local +.env*.local # vercel .vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/.gitignore b/.gitignore index 1437c53f..c87c9b39 100644 --- a/.gitignore +++ b/.gitignore @@ -23,12 +23,14 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +.pnpm-debug.log* # local env files -.env.local -.env.development.local -.env.test.local -.env.production.local +.env*.local # vercel .vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/README.md b/README.md index 0eae6ec3..3f0f0ea0 100644 --- a/README.md +++ b/README.md @@ -2,32 +2,6 @@ [あなたのオタクタイプ診断 by あにまーれ (あにまーれ診断)](https://shindan.animare.cafe/) は有閑喫茶あにまーれや有閑喫茶あにまーれに所属するメンバーを題材とした非公式のウェブサービスです。[あなたのオタクタイプ診断 by IRIAM](https://shindan.iriam.com/) をオリジナルとして、デザインやレイアウトの転用をしていますが素材の流用は一切行っていません。 -## 一覧 - -| ID | タイプ | 名前 | -| -------------- | -------------- | ---------- | -| [`3bXvK25U`][] | お料理系メイド | 因幡はねる | -| [`4yoyHoB7`][] | メガネ系先生 | 因幡はねる | -| [`DAltKHae`][] | 最速系書家 | 因幡はねる | -| [`hUuAaZpw`][] | 清楚系うさぎ | 因幡はねる | -| [`jk54nVLu`][] | 努力系ゲーマー | 因幡はねる | -| [`kJN5x4Vl`][] | 料理上手系店員 | 因幡はねる | -| [`rKAeiUil`][] | 3D 系うさぎ | 因幡はねる | -| [`sJEfGEiw`][] | サンタ系彼女 | 因幡はねる | -| [`Tm3fKyEP`][] | 知性派系アナ | 因幡はねる | -| [`xGr4nzdz`][] | 浴衣系彼女 | 因幡はねる | - ## ライセンス [MIT](LICENSE) - -[`3bxvk25u`]: https://shindan.animare.cafe/s/3bXvK25U?s=true -[`4yoyhob7`]: https://shindan.animare.cafe/s/4yoyHoB7?s=true -[`daltkhae`]: https://shindan.animare.cafe/s/DAltKHae?s=true -[`huuaazpw`]: https://shindan.animare.cafe/s/hUuAaZpw?s=true -[`jk54nvlu`]: https://shindan.animare.cafe/s/jk54nVLu?s=true -[`kjn5x4vl`]: https://shindan.animare.cafe/s/kJN5x4Vl?s=true -[`rkaeiuil`]: https://shindan.animare.cafe/s/rKAeiUil?s=true -[`sjefgeiw`]: https://shindan.animare.cafe/s/sJEfGEiw?s=true -[`tm3fkyep`]: https://shindan.animare.cafe/s/Tm3fKyEP?s=true -[`xgr4nzdz`]: https://shindan.animare.cafe/s/xGr4nzdz?s=true diff --git a/components/footer.tsx b/components/footer.tsx index e00b981f..7939e690 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -3,8 +3,6 @@ import styled from 'styled-components' import pkg from '../package.json' -import type { VFC } from 'react' - const Content = styled.footer` align-items: center; background-color: #fff; @@ -15,7 +13,7 @@ const Content = styled.footer` padding: 20px 12px 32px; ` -const ReleaseLink = styled.a` +const ReleaseLink = styled(Link)` color: #000; display: block; font-size: 1.2rem; @@ -38,17 +36,15 @@ const Copyright = styled.p` } ` -const Footer: VFC = () => { +export default function Footer(): JSX.Element { return ( - - - Version {pkg.version.split('.').slice(0, 2).join('.')} - - + + Version {pkg.version.split('.').slice(0, 2).join('.')} + - {'Copyright 2018-2022 '} + {'Copyright 2018-2023 '} Haneru Developers @@ -56,5 +52,3 @@ const Footer: VFC = () => { ) } - -export default Footer diff --git a/components/header.tsx b/components/header.tsx index bd0bba6b..9ae89019 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -6,8 +6,6 @@ import twitterLogo from '../assets/twitter.svg' import { createLineShareURL, createTweetURL } from '../lib/share' import pkg from '../package.json' -import type { VFC } from 'react' - const Container = styled.header` align-items: center; display: flex; @@ -18,7 +16,7 @@ const Container = styled.header` width: 100%; ` -const Logo = styled.a` +const Logo = styled(Link)` background-color: #212121; border-radius: 3px; color: #fff; @@ -70,12 +68,12 @@ const ShareLogo = styled.img` } ` -const Header: VFC = () => { +export default function Header(): JSX.Element { return ( - - ANiMARE - + + ANiMARE +
    @@ -107,5 +105,3 @@ const Header: VFC = () => { ) } - -export default Header diff --git a/next-env.d.ts b/next-env.d.ts deleted file mode 100644 index 4f11a03d..00000000 --- a/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/pages/index.tsx b/pages/index.tsx index cdaa764b..6e7fc81f 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -6,8 +6,6 @@ import Layout from '../components/layout' import Message from '../components/message' import SEO from '../components/seo' -import type { NextPage } from 'next' - const Content = styled.main` padding-top: 30px; ` @@ -67,7 +65,7 @@ const Intro = styled.p` } ` -const Button = styled.a` +const Button = styled(Link)` align-items: center; background-color: #0588f7; border: solid #000 4px; @@ -107,74 +105,75 @@ const Disclaimer = styled.p` } ` -const Index: NextPage = () => ( - - - -
    - - - - - <span>アナタの</span> - <span>オタクタイプ診断</span> - - - アナタの隠されたオタクタイプを徹底診断! -
    - アナタにマッチするVTuberの、 -
    - オススメ動画も…? -
    - - アナタはどんなオタクタイプ? - - - - - - ※このサービスは - - 株式会社IRIAM - - が提供するアプリである『 - - IRIAM - - 』 の関連サービスとして公開されていた『あなたのオタクタイプ診断 by - IRIAM』をオリジナルとして、 - - 774 inc. - {' '} - が運営しているバーチャルYouTuberグループ『有閑喫茶 - あにまーれ』をモチーフにして株式会社IRIAMや774 inc. とは一切関係のない - - Haneru Developers - - によって開発と運営が行われている非公式のサービスになります。 -
    - このサービスに関するお問い合わせをHaneru - Developers以外の団体や個人に対して行うのはお止めください。 -
    -
    -
    - -) - -export default Index +export default function IndexPage(): JSX.Element { + return ( + + + +
    + + + + + <span>アナタの</span> + <span>オタクタイプ診断</span> + + + アナタの隠されたオタクタイプを徹底診断! +
    + アナタにマッチするVTuberの、 +
    + オススメ動画も…? +
    + + アナタはどんなオタクタイプ? + + + + ※このサービスは + + 株式会社IRIAM + + が提供するアプリである『 + + IRIAM + + 』 の関連サービスとして公開されていた『あなたのオタクタイプ診断 by + IRIAM』をオリジナルとして、 + + 774 inc. + {' '} + が運営しているバーチャルYouTuberグループ『有閑喫茶 + あにまーれ』をモチーフにして株式会社IRIAMや774 inc. + とは一切関係のない + + Haneru Developers + + によって開発と運営が行われている非公式のサービスになります。 +
    + このサービスに関するお問い合わせをHaneru + Developers以外の団体や個人に対して行うのはお止めください。 +
    +
    +
    + + ) +} diff --git a/pages/s/[slug].tsx b/pages/s/[slug].tsx index f15f89db..76759c2d 100644 --- a/pages/s/[slug].tsx +++ b/pages/s/[slug].tsx @@ -1,3 +1,4 @@ +import { type GetStaticPaths, type GetStaticProps } from 'next' import Link from 'next/link' import { useEffect, useState } from 'react' import styled from 'styled-components' @@ -7,14 +8,12 @@ import Avatar from '../../components/avatar' import Graph from '../../components/graph' import Layout from '../../components/layout' import MessageWindow from '../../components/message-window' - -import type { Result } from '../../lib/analysis' - import SEO from '../../components/seo' - -import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' - -import { getAnalysisResult, getAnalysisResultIDs } from '../../lib/analysis' +import { + type Result, + getAnalysisResult, + getAnalysisResultIDs +} from '../../lib/analysis' import { createTweetURL } from '../../lib/share' import pkg from '../../package.json' @@ -179,7 +178,7 @@ const ShareButton = styled.a` } ` -const RetryButton = styled.a` +const RetryButton = styled(Link)` align-items: center; background-color: #fff; border: solid #ececec 3px; @@ -200,7 +199,7 @@ const RetryButton = styled.a` } ` -const Button = styled.a` +const Button = styled(Link)` align-items: center; background-color: #fff; border: solid #14b9ff 4px; @@ -381,7 +380,7 @@ type Props = { result: Result } -const AnalysisResult: NextPage = ({ result }) => { +export default function AnalysisResult({ result }: Props): JSX.Element { const [isShared, setIsShared] = useState(true) useEffect(() => { @@ -440,9 +439,9 @@ const AnalysisResult: NextPage = ({ result }) => { > 診断結果をツイートする - - もう一度診断する - + + もう一度診断する + )} @@ -450,9 +449,9 @@ const AnalysisResult: NextPage = ({ result }) => { {!isShared && ( - - - + )} @@ -539,17 +538,15 @@ const AnalysisResult: NextPage = ({ result }) => { - - - + ) } -export default AnalysisResult - type Params = { slug: string }