Skip to content

Commit

Permalink
Botao voltar ao inicio inserido na tela de resultados
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdlm committed Oct 12, 2021
1 parent f0d1074 commit 4437fc1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pages/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import QuizContainer from "../src/components/QuizContainer";
import Button from "../src/components/Button";
import AlternativesForm from "../src/components/AlternativeForms";
import BackLinkArrow from "../src/components/BackLinkArrow";
import { useRouter } from "next/router";

function ResultWidget({ results }) {
const router = useRouter();
return (
<Widget>
<Widget style={{ margin: "0 auto" }}>
<Widget.Header>RESULTADO</Widget.Header>
<Widget.Content>
<p>{`Você acertou ${results.filter((x) => x).length} questões`}</p>
Expand All @@ -23,6 +25,13 @@ function ResultWidget({ results }) {
))}
</ul>
</Widget.Content>
<Button
onClick={() => {
router.push(`/`);
}}
>
Voltar para inicio
</Button>
</Widget>
);
}
Expand Down Expand Up @@ -51,7 +60,7 @@ function QuestionWidget({
const hasAlternativeSelected = selectedAlternative !== undefined;
return (
<>
<Widget>
<Widget style={{ margin: "0 auto" }}>
<Widget.Header>
<BackLinkArrow href="/" />
<h3>
Expand Down

1 comment on commit 4437fc1

@vercel
Copy link

@vercel vercel bot commented on 4437fc1 Oct 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.