Skip to content

Commit

Permalink
feat: QuizCoachmark > 튜토리얼 닫기 시 종료로 판단
Browse files Browse the repository at this point in the history
  • Loading branch information
YuHyun-P committed Feb 3, 2024
1 parent c9da15f commit 4bea7d5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EVENTS } from "react-joyride";
import { ACTIONS, EVENTS } from "react-joyride";

import { Coachmark, type CoachmarkProps } from "../../coachmark";

Expand All @@ -10,13 +10,14 @@ export function QuizCoachmark({ onTourEnd }: QuizCoachmarkProps) {
const handleProgress: CoachmarkProps["callback"] = ({
index: stepIndex,
type,
action,
}) => {
if (stepIndex === HEARDER_OVERLAP_STEP && type === EVENTS.TOOLTIP) {
window?.scroll(0, 0);
return;
}

if (type === EVENTS.TOUR_END) {
if (type === EVENTS.TOUR_END || action === ACTIONS.CLOSE) {
onTourEnd();
}
};
Expand Down

0 comments on commit 4bea7d5

Please sign in to comment.