Change
This commit is contained in:
30
app/page.tsx
30
app/page.tsx
@@ -2,8 +2,6 @@
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import {
|
||||
@@ -13,19 +11,17 @@ import {
|
||||
|
||||
export default function Home() {
|
||||
const options = [
|
||||
"Kino",
|
||||
"Casino",
|
||||
"Spielothek",
|
||||
"Kneipe",
|
||||
"Kulturbühne"
|
||||
"Drachenzähmen leicht gemacht",
|
||||
"Casino Royale",
|
||||
"Baywatch",
|
||||
"Bad Boys",
|
||||
"Jumanji",
|
||||
"Fast and Furious"
|
||||
]
|
||||
const correctAnswer = "Spielothek"
|
||||
const nextLink = "https://six.christian.miniquiz.your-apps.dev";
|
||||
const correctAnswer = "Jumanji"
|
||||
|
||||
const [selectedAnswer, setSelectedAnswer] = React.useState<string | null>(null);
|
||||
const [showNextLink, setShowNextLink] = React.useState<boolean>(false);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const handleAnswerChange = (value: string) => {
|
||||
setSelectedAnswer(value);
|
||||
@@ -41,18 +37,13 @@ export default function Home() {
|
||||
return;
|
||||
}
|
||||
alert("Richtige Antwort!")
|
||||
setShowNextLink(true);
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
router.push(nextLink);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-screen p-10 gap-4">
|
||||
<div className="flex flex-col items-center justify-center max-w-2xl w-full gap-8">
|
||||
<h1 className="text-4xl font-bold">18. Geburtstag</h1>
|
||||
<p className="text-lg text-zinc-500">Welchen Ort wolltest du bereits in München die ganze Zeit besuchen, wo nur Erwachsene hin dürfen?</p>
|
||||
<p className="text-lg text-zinc-500">In diesem gleichnahmigen Film spielen "Robin Williams" und später "Dwayne Johnson" eine Hauptrolle?</p>
|
||||
<RadioGroup onValueChange={handleAnswerChange} value={selectedAnswer} className="flex flex-col items-start justify-start w-full">
|
||||
{options.map((option) => (
|
||||
<div key={option} className="text-2xl font-bold flex items-center justify-start border border-zinc-300 gap-2 rounded-md p-4 w-full">
|
||||
@@ -61,10 +52,7 @@ export default function Home() {
|
||||
</div>
|
||||
))}
|
||||
</RadioGroup>
|
||||
<Button onClick={handleSubmit} className="w-full" size="lg" disabled={showNextLink}>Antworten</Button>
|
||||
{showNextLink && (
|
||||
<Button onClick={handleNext} className="w-full" size="lg">Nächste Frage</Button>
|
||||
)}
|
||||
<Button onClick={handleSubmit} className="w-full" size="lg">Antworten</Button>
|
||||
</div>
|
||||
<p className="text-sm text-zinc-500">
|
||||
<b>WICHTIG!</b> Merke dir die Antwort. Du wirst die Überraschung selber enthüllen.
|
||||
|
||||
Reference in New Issue
Block a user