0
0
mirror of https://github.com/yude-jp/yude.jp synced 2025-10-13 03:38:36 +09:00

Fix 404 page @ minecraft/players/[uuid]

This commit is contained in:
2021-09-26 13:36:23 +09:00
parent 5276456ac2
commit ea617dd8dc
4 changed files with 48 additions and 37 deletions

View File

@@ -6,11 +6,12 @@ import { useRouter } from 'next/router'
// Data fetching
import Players from '../../components/Minecraft/Players'
import PlayerName from '../../components/Minecraft/PlayerName'
import useSwr from 'swr'
const fetcher = (url) => fetch(url).then((res) => res.json())
// Components
import WrongUUID from '../../components/Minecraft/WrongUUID'
export default function UUID() {
const router = useRouter()
const { uuid } = router.query
@@ -36,13 +37,23 @@ export default function UUID() {
</>
)
} else {
if (!data.username) {
return (
<>
<Layout title={data.username + " - " + "プレイヤー情報"}>
<Players uuid={uuid} />
<Layout title="404 - プレイヤー情報">
<WrongUUID />
</Layout>
</>
)
} else {
return (
<>
<Layout title={data.username + " - " + "プレイヤー情報"}>
<Players uuid={uuid} />
</Layout>
</>
)
}
}
}
}