From e3e1037a853dc64d7c3067bd25deffb3fb29051c Mon Sep 17 00:00:00 2001 From: Theis Date: Wed, 21 Jan 2026 16:27:32 +0100 Subject: [PATCH] feat: update SuccessPage with countdown and return button; localize return button text --- frontend/index.html | 2 +- frontend/src/pages/SuccessPage.tsx | 38 +++++++++++++++++++++- frontend/src/utils/i18n/locales/de/de.json | 6 ++-- frontend/src/utils/i18n/locales/en/en.json | 3 +- 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 072a57e..9b6bc52 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - frontend + Lose verkaufen
diff --git a/frontend/src/pages/SuccessPage.tsx b/frontend/src/pages/SuccessPage.tsx index ae54f10..4995e7d 100644 --- a/frontend/src/pages/SuccessPage.tsx +++ b/frontend/src/pages/SuccessPage.tsx @@ -1,4 +1,4 @@ -import { Box, Paper, Typography, Chip } from "@mui/material"; +import { Box, Paper, Typography, Chip, Button } from "@mui/material"; import { useEffect, useState } from "react"; import { CircleCheck } from "lucide-react"; import { useTranslation } from "react-i18next"; @@ -8,6 +8,7 @@ export const SuccessPage = () => { const [tickets, setNumberOfTickets] = useState(0); const [animate, setAnimate] = useState(false); const { t } = useTranslation(); + const [seconds, setSeconds] = useState(30); useEffect(() => { const params = new URLSearchParams(window.location.search); @@ -20,6 +21,17 @@ export const SuccessPage = () => { setTimeout(() => setAnimate(true), 100); }, []); + useEffect(() => { + if (seconds === 0) { + window.location.href = "/"; + return; + } + + const timer = setTimeout(() => setSeconds(seconds - 1), 1000); + + return () => clearTimeout(timer); + }, [seconds]); + return ( { )} + {/* Return button */} + + + + {/* Additional Info */}