@bbki.ng/site 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import React from "react";
|
|
|
10
10
|
import { useNavigate } from "react-router-dom";
|
|
11
11
|
import { supabase } from "@/constants";
|
|
12
12
|
import { toast } from "sonner";
|
|
13
|
+
import { confirm } from "@/utils";
|
|
13
14
|
|
|
14
15
|
export const LoginMenuItem = () => {
|
|
15
16
|
const sess = useSupabaseSession();
|
|
@@ -17,18 +18,16 @@ export const LoginMenuItem = () => {
|
|
|
17
18
|
|
|
18
19
|
if (sess?.user != null) {
|
|
19
20
|
return (
|
|
20
|
-
<>
|
|
21
|
-
<ContextMenuLabel inset>
|
|
22
|
-
{sess?.user?.email ?? ""}
|
|
23
|
-
</ContextMenuLabel>
|
|
24
21
|
<ContextMenuItem
|
|
25
22
|
inset
|
|
26
23
|
onClick={() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
confirm("确定退出登录吗?", () => {
|
|
25
|
+
supabase.auth.signOut().then(() => {
|
|
26
|
+
toast.success("已退出登录", {
|
|
27
|
+
position: "bottom-right",
|
|
28
|
+
});
|
|
30
29
|
});
|
|
31
|
-
})
|
|
30
|
+
})
|
|
32
31
|
}}
|
|
33
32
|
>
|
|
34
33
|
{sess?.user?.user_metadata && (
|
|
@@ -40,9 +39,8 @@ export const LoginMenuItem = () => {
|
|
|
40
39
|
crossOrigin="anonymous"
|
|
41
40
|
/>
|
|
42
41
|
)}
|
|
43
|
-
|
|
42
|
+
{sess?.user?.email ?? ""}
|
|
44
43
|
</ContextMenuItem>
|
|
45
|
-
</>
|
|
46
44
|
);
|
|
47
45
|
}
|
|
48
46
|
|
|
@@ -3,6 +3,8 @@ import React from "react";
|
|
|
3
3
|
import { GITHUB_REPO_ADDRESS } from "@/constants";
|
|
4
4
|
|
|
5
5
|
export const ViewSourceMenuItem = () => {
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
const appVer = GLOBAL_BBKING_VERSION;
|
|
6
8
|
return (
|
|
7
9
|
<ContextMenuItem
|
|
8
10
|
onClick={() => {
|
|
@@ -21,7 +23,7 @@ export const ViewSourceMenuItem = () => {
|
|
|
21
23
|
>
|
|
22
24
|
<path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path>
|
|
23
25
|
</svg>
|
|
24
|
-
|
|
26
|
+
v{appVer}
|
|
25
27
|
<ContextMenuShortcut>s</ContextMenuShortcut>
|
|
26
28
|
</ContextMenuItem>
|
|
27
29
|
);
|
|
@@ -34,7 +34,6 @@ export const AppCtxMenu = (props: { children: ReactElement }) => {
|
|
|
34
34
|
<ContextMenuTrigger>{props.children}</ContextMenuTrigger>
|
|
35
35
|
<ContextMenuContent className="w-256">
|
|
36
36
|
<LoginMenuItem />
|
|
37
|
-
<VersionMenuItem />
|
|
38
37
|
<ViewSourceMenuItem />
|
|
39
38
|
{showPluginEntry && (
|
|
40
39
|
<>
|