Skip to content

Commit 9acb2f1

Browse files
cyfung1031CodFrm
andauthored
🐛(UI) 新手指引按钮显示不全 #1396 (#1398)
* fix(UI): 新手指引按钮显示不全 #1396 * fix step order * 修正 setGuideMode 未正确设定问题 * 注釋 --------- Co-authored-by: 王一之 <yz@ggnb.top>
1 parent 72f5e93 commit 9acb2f1

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/pages/components/layout/SiderGuide.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useImperativeHandle, useState } from "react";
22
import { useTranslation } from "react-i18next";
33
import type { Step } from "react-joyride";
4-
import Joyride from "react-joyride";
4+
import Joyride, { STATUS } from "react-joyride";
55
import type { Path } from "react-router-dom";
66
import { useLocation, useNavigate } from "react-router-dom";
77
import CustomTrans from "../CustomTrans";
@@ -28,6 +28,7 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
2828
// 隐身模式不打开引导
2929
if (!chrome.extension.inIncognitoContext) {
3030
setRun(true);
31+
setGuideMode(true);
3132
}
3233
}
3334
}, []);
@@ -48,11 +49,16 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
4849
content: <CustomTrans i18nKey="guide_script_list_content" />,
4950
target: "#script-list",
5051
title: t("guide_script_list_title"),
51-
placement: "auto",
52+
placement: "center",
5253
},
5354
];
5455

5556
steps.push(
57+
{
58+
target: ".script-sort",
59+
title: t("guide_script_list_sort_title"),
60+
content: t("guide_script_list_sort_content"),
61+
},
5662
{
5763
content: t("guide_script_list_enable_content"),
5864
target: ".script-enable",
@@ -63,11 +69,6 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
6369
target: ".apply_to_run_status",
6470
title: t("guide_script_list_apply_to_run_status_title"),
6571
},
66-
{
67-
target: ".script-sort",
68-
title: t("guide_script_list_sort_title"),
69-
content: t("guide_script_list_sort_content"),
70-
},
7172
{
7273
target: ".script-updatetime",
7374
title: t("guide_script_list_update_title"),
@@ -148,6 +149,10 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, object> =
148149
hash: location.hash,
149150
});
150151
}
152+
if (data.status === STATUS.FINISHED || data.status === STATUS.SKIPPED) {
153+
setGuideMode(false);
154+
// finish / skip: 停在当前画面
155+
}
151156
}}
152157
locale={{
153158
nextLabelWithProgress: t("next_with_progress"),

0 commit comments

Comments
 (0)