From e6011f84b76737022cb0ef4c3783ef726cacd95e Mon Sep 17 00:00:00 2001 From: Osamu Takiya Date: Sun, 19 Jun 2022 22:43:21 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20=E5=9E=8B=E3=81=AE?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E3=81=8C=E3=83=AD=E3=83=BC=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=A1=E3=83=AB=E3=82=B1=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=91=E3=83=BC=E3=82=AD=E3=83=A3=E3=83=A1=E3=83=AB=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/unite-attacks-list/AttacksList.tsx | 10 +++++----- pages/unite-attacks-list.tsx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/unite-attacks-list/AttacksList.tsx b/components/unite-attacks-list/AttacksList.tsx index 6dc6aef8..695c7dc1 100644 --- a/components/unite-attacks-list/AttacksList.tsx +++ b/components/unite-attacks-list/AttacksList.tsx @@ -1,7 +1,7 @@ import type { NextPage } from 'next' import useTranslation from 'next-translate/useTranslation' -type attack = { +type Attack = { id: number name: string name_en: string @@ -9,12 +9,12 @@ type attack = { page_annotation: string } -type apiResponse = { - [key: string]: attack[] +type ApiResponse = { + [key: string]: Attack[] } type Props = { - apiResponse: apiResponse + apiResponse: ApiResponse } export const AttacksList: NextPage = ({ apiResponse }) => { @@ -33,7 +33,7 @@ export const AttacksList: NextPage = ({ apiResponse }) => {
    - {apiResponse[title].map((attack: attack) => { + {apiResponse[title].map((attack: Attack) => { return (
  • diff --git a/pages/unite-attacks-list.tsx b/pages/unite-attacks-list.tsx index 5df485f3..52dcb2a7 100644 --- a/pages/unite-attacks-list.tsx +++ b/pages/unite-attacks-list.tsx @@ -10,7 +10,7 @@ import { SiteFooter } from '@/components/common/SiteFooter' import { AttacksList } from '@/components/unite-attacks-list/AttacksList' -type attack = { +type Attack = { id: number name: string name_en: string @@ -18,13 +18,13 @@ type attack = { page_annotation: string } -type apiResponse = { - [key: string]: attack[] +type ApiResponse = { + [key: string]: Attack[] } const UniteAttacksList: NextPage = () => { const [nowLoading, setNowLoading] = useState(true) - const [apiResponse, setApiResponse] = useState({}) + const [apiResponse, setApiResponse] = useState({}) // TODO: 開発サーバが動的に使えるように環境変数で定義する const apiUrl = 'https://headquarters.suikoden.info/unite_attacks?title=all'