From f5f49c27ead7df647f2373a7024f6cbcb6e621cf Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Fri, 30 Jan 2026 23:04:42 -0700 Subject: [PATCH] Add refresh buttons to these pages --- src/app/components/ReloadButton.tsx | 17 ++++++++++++ src/app/game/berry-dash/splash/page.tsx | 27 ++++++++++++------- .../game/berry-dash/splash/submit/page.tsx | 4 +-- 3 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 src/app/components/ReloadButton.tsx diff --git a/src/app/components/ReloadButton.tsx b/src/app/components/ReloadButton.tsx new file mode 100644 index 0000000..006e9f3 --- /dev/null +++ b/src/app/components/ReloadButton.tsx @@ -0,0 +1,17 @@ +import { faArrowsRotate } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' + +export function ReloadButton ({ action }: { action: () => void }) { + return ( + <> +
+ +
+ + ) +} diff --git a/src/app/game/berry-dash/splash/page.tsx b/src/app/game/berry-dash/splash/page.tsx index 1160852..474ce6b 100644 --- a/src/app/game/berry-dash/splash/page.tsx +++ b/src/app/game/berry-dash/splash/page.tsx @@ -1,7 +1,7 @@ 'use client' import { BackButton } from '@/app/components/BackButton' -import { DiscordButton } from '@/app/components/DiscordButton' +import { ReloadButton } from '@/app/components/ReloadButton' import axios from 'axios' import Link from 'next/link' import { useEffect, useState } from 'react' @@ -9,22 +9,29 @@ import { useEffect, useState } from 'react' export default function BerryDashSplash () { const [response, setResponse] = useState(null) + async function Refresh () { + try { + const request = await axios.get('/api/berrydash/splash-text') + setResponse(request.data) + } catch { + setResponse(-1) + } + } + useEffect(() => { document.title = 'Lncvrt Games - Berry Dash Splash Texts' - ;(async () => { - try { - const request = await axios.get('/api/berrydash/splash-text') - setResponse(request.data) - } catch { - setResponse(-1) - } - })() + Refresh() }, []) return (
- + { + setResponse(null) + Refresh() + }} + />

Berry Dash Splash Texts

diff --git a/src/app/game/berry-dash/splash/submit/page.tsx b/src/app/game/berry-dash/splash/submit/page.tsx index 8450080..bcc89d2 100644 --- a/src/app/game/berry-dash/splash/submit/page.tsx +++ b/src/app/game/berry-dash/splash/submit/page.tsx @@ -1,7 +1,7 @@ 'use client' import { BackButton } from '@/app/components/BackButton' -import { DiscordButton } from '@/app/components/DiscordButton' +import { ReloadButton } from '@/app/components/ReloadButton' import { getCookie } from '@/util/cookie' import { Turnstile } from '@marsidev/react-turnstile' import axios from 'axios' @@ -26,7 +26,7 @@ export default function BerryDashSubmitSplash () { return (
- + window.location.reload()} />

{loading ? 'Loading...'