Fix(Bug) Update Feedback.tsx component visiblity issue (#6533)

* Update Feedback.tsx

* Update Feedback.tsx

Time reduced to 1.5 seconds, also going to update css

* Update index.css

CSS updated for feedback component animation.

* Update Feedback.tsx

* Update index.css

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
This commit is contained in:
Abdul Rahman
2024-01-09 07:52:15 +05:30
committed by GitHub
parent bb0ac87ce4
commit 083c308de8
2 changed files with 12 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
import {useState} from 'react';
import {useRouter} from 'next/router';
import cn from 'classnames';
export function Feedback({onSubmit = () => {}}: {onSubmit?: () => void}) {
const {asPath} = useRouter();
@@ -60,7 +61,11 @@ function sendGAEvent(isPositive: boolean) {
function SendFeedback({onSubmit}: {onSubmit: () => void}) {
const [isSubmitted, setIsSubmitted] = useState(false);
return (
<div className="max-w-xs w-80 lg:w-auto py-3 shadow-lg rounded-lg m-4 bg-wash dark:bg-gray-95 px-4 flex">
<div
className={cn(
'max-w-xs w-80 lg:w-auto py-3 shadow-lg rounded-lg m-4 bg-wash dark:bg-gray-95 px-4 flex',
{exit: isSubmitted}
)}>
<p className="w-full font-bold text-primary dark:text-primary-dark text-lg me-4">
{isSubmitted ? 'Thank you for your feedback!' : 'Is this page useful?'}
</p>

View File

@@ -719,3 +719,9 @@ ol.mdx-illustration-block {
width: 100%;
}
}
.exit {
opacity: 0;
transition: opacity 500ms ease-out;
transition-delay: 1s;
}