diff --git a/typing-app/src/components/templates/GameResult.tsx b/typing-app/src/components/templates/GameResult.tsx index 1b32570..bb74789 100644 --- a/typing-app/src/components/templates/GameResult.tsx +++ b/typing-app/src/components/templates/GameResult.tsx @@ -2,6 +2,7 @@ import { ResultScore } from "@/types/RegisterScore"; import { Button, Grid, GridItem, Text } from "@chakra-ui/react"; import React from "react"; import styles from "./GameResult.module.css"; +import { useRouter } from "next/navigation"; interface GameResultProps { nextPage: () => void; @@ -9,6 +10,12 @@ interface GameResultProps { } const GameResult: React.FC = ({ nextPage, resultScore }) => { + const router = useRouter(); + + const pushToRoot = () => { + router.push("/"); + }; + return (
@@ -86,9 +93,14 @@ const GameResult: React.FC = ({ nextPage, resultScore }) => { {resultScore.accuracy.toFixed(1)}% - - + + +