From 7b6dbdec8b0960255e5c700cdbc7c2c73b360d8a Mon Sep 17 00:00:00 2001 From: YuHyun Date: Tue, 2 Jan 2024 17:23:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=80=B4=EC=A6=88=20=ED=8A=9C=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=EC=96=BC=20>=20=ED=97=A4=EB=8D=94=EC=99=80=20Git=20gr?= =?UTF-8?q?aph=20step=EC=9D=98=20spotlight=20=EA=B2=B9=EC=B9=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#304] --- .../quiz/QuizCoachmark/QuizCoachmark.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/quiz/QuizCoachmark/QuizCoachmark.tsx b/packages/frontend/src/components/quiz/QuizCoachmark/QuizCoachmark.tsx index 34bb01b..bdf7101 100644 --- a/packages/frontend/src/components/quiz/QuizCoachmark/QuizCoachmark.tsx +++ b/packages/frontend/src/components/quiz/QuizCoachmark/QuizCoachmark.tsx @@ -7,8 +7,18 @@ interface QuizCoachmarkProps { } export function QuizCoachmark({ onTourEnd }: QuizCoachmarkProps) { - const handleProgress: CoachmarkProps["callback"] = ({ type }) => { - if (type === EVENTS.TOUR_END) onTourEnd(); + const handleProgress: CoachmarkProps["callback"] = ({ + index: stepIndex, + type, + }) => { + if (stepIndex === HEARDER_OVERLAP_STEP && type === EVENTS.TOOLTIP) { + window?.scroll(0, 0); + return; + } + + if (type === EVENTS.TOUR_END) { + onTourEnd(); + } }; return ( @@ -18,6 +28,7 @@ export function QuizCoachmark({ onTourEnd }: QuizCoachmarkProps) { showProgress showSkipButton callback={handleProgress} + disableScrolling /> ); } @@ -29,6 +40,9 @@ export const COACHMARK_TARGETS = { RESIZABLE: "coach--resizable", }; +const GIT_GRAPH_STEP = 0; +const HEARDER_OVERLAP_STEP = GIT_GRAPH_STEP; + const STEPS: CoachmarkProps["steps"] = [ { title: "Git ๊ทธ๋ž˜ํ”„",