diff --git a/src/components/Layout/Feedback.tsx b/src/components/Layout/Feedback.tsx index 6bb8a4aac6d..b99b35cadf6 100644 --- a/src/components/Layout/Feedback.tsx +++ b/src/components/Layout/Feedback.tsx @@ -2,7 +2,7 @@ * Copyright (c) Facebook, Inc. and its affiliates. */ -import {useState} from 'react'; +import {useEffect, useState} from 'react'; import {useRouter} from 'next/router'; import {ga} from '../../utils/analytics'; @@ -60,8 +60,21 @@ function sendGAEvent(isPositive: boolean) { function SendFeedback({onSubmit}: {onSubmit: () => void}) { const [isSubmitted, setIsSubmitted] = useState(false); + const [isVisible, setIsVisible] = useState(true); + + useEffect(() => { + if (isSubmitted) { + setInterval(() => { + setIsVisible(false); + }, 2500); + } + }, [isSubmitted]); + return ( -
{isSubmitted ? 'Thank you for your feedback!' : 'Is this page useful?'}