From 21789101fdf98cafe6771a13e7df4f332b6b23d0 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 30 Jan 2026 18:50:07 +0100 Subject: [PATCH] Fix scroll --- web/pages/onboarding/index.tsx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/web/pages/onboarding/index.tsx b/web/pages/onboarding/index.tsx index b3d1411..51ab678 100644 --- a/web/pages/onboarding/index.tsx +++ b/web/pages/onboarding/index.tsx @@ -1,4 +1,4 @@ -import {useState} from 'react' +import {useEffect, useState} from 'react' import {Col} from 'web/components/layout/col' import Router from 'next/router' import {Button} from 'web/components/buttons/button' @@ -32,6 +32,17 @@ function OnboardingScreen({ welcomeTitle }: OnboardingScreenProps) { const t = useT() + const [showWelcome, setShowWelcome] = useState(!!welcomeTitle) + + useEffect(() => { + if (welcomeTitle) { + const timer = setTimeout(() => { + setShowWelcome(false) + }, 3000) + return () => clearTimeout(timer) + } + }, [welcomeTitle]) + return ( {onBack && ( @@ -45,14 +56,9 @@ function OnboardingScreen({ )} - {welcomeTitle && ( -

- {welcomeTitle} -

- )} - -

- {title} +

+ {showWelcome && welcomeTitle ? welcomeTitle : title}

@@ -184,10 +190,12 @@ export default function OnboardingPage() { const [currentStep, setCurrentStep] = useState(0) const handleNext = () => { + window.scrollTo(0, 0) setCurrentStep(currentStep + 1) } const handleBack = () => { + window.scrollTo(0, 0) setCurrentStep(currentStep - 1) }