Skip to content

Commit 766ac4e

Browse files
committed
auto close feedback modal after submission
1 parent b43503d commit 766ac4e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/components/docFeedback/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ export function DocFeedback({pathname}: Props) {
2424
}
2525
}, [pathname]);
2626

27+
// Auto-close modal after feedback submission
28+
useEffect(() => {
29+
if (feedbackSubmitted && showFeedbackModal) {
30+
const timer = setTimeout(() => {
31+
setShowFeedbackModal(false);
32+
}, 3000);
33+
34+
return () => clearTimeout(timer);
35+
}
36+
}, [feedbackSubmitted, showFeedbackModal]);
37+
2738
const handleFeedback = (helpful: boolean) => {
2839
emit('Doc Feedback', {props: {page: pathname, helpful}});
2940

0 commit comments

Comments
 (0)