@bbki.ng/site 1.1.24 → 1.1.26
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 +4 -0
- package/package.json +3 -3
- package/src/components/Logger.tsx +8 -0
- package/src/components/hotkey_nav/index.tsx +2 -1
- package/src/components/reload_prompt/index.tsx +11 -1
- package/src/constants/routes.ts +1 -0
- package/src/main.tsx +2 -0
- package/src/pages/cover/index.tsx +17 -21
- package/vite.config.js +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/site",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26",
|
|
4
4
|
"description": "code behind bbki.ng",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"url": "git+https://github.com/bbbottle/bbki.ng.git"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@bbki.ng/components": "workspace:2.1.
|
|
19
|
+
"@bbki.ng/components": "workspace:2.1.43",
|
|
20
20
|
"@supabase/supabase-js": "^1.30.6",
|
|
21
21
|
"classnames": "2.3.1",
|
|
22
22
|
"react": "^18.0.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"swr": "^1.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@bbki.ng/stylebase": "workspace:0.0.
|
|
31
|
+
"@bbki.ng/stylebase": "workspace:0.0.22",
|
|
32
32
|
"@mdx-js/mdx": "2.0.0-next.9",
|
|
33
33
|
"@mdx-js/react": "^1.6.22",
|
|
34
34
|
"@mdx-js/rollup": "3.0.0",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { useNavigate } from "react-router-dom";
|
|
3
2
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
4
3
|
import { GITHUB_REPO_ADDRESS, ROUTES } from "@/constants";
|
|
@@ -14,6 +13,7 @@ enum HotKeys {
|
|
|
14
13
|
b = "b",
|
|
15
14
|
h = "h",
|
|
16
15
|
s = "s",
|
|
16
|
+
l = "l",
|
|
17
17
|
T = "shift+t",
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,6 +22,7 @@ const KEY_ROUTES = [
|
|
|
22
22
|
{ key: HotKeys.c, route: ROUTES.CONTENT },
|
|
23
23
|
{ key: HotKeys.h, route: ROUTES.HELP },
|
|
24
24
|
{ key: HotKeys.t, route: ROUTES.TAGS },
|
|
25
|
+
{ key: HotKeys.l, route: ROUTES.LOGIN },
|
|
25
26
|
];
|
|
26
27
|
|
|
27
28
|
export const HotKeyNav = (props: any) => {
|
|
@@ -2,6 +2,7 @@ import { toast } from "sonner";
|
|
|
2
2
|
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
import { useRegisterSW } from "virtual:pwa-register/react";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
5
6
|
|
|
6
7
|
export const ReloadPrompt = () => {
|
|
7
8
|
const {
|
|
@@ -16,8 +17,17 @@ export const ReloadPrompt = () => {
|
|
|
16
17
|
},
|
|
17
18
|
});
|
|
18
19
|
|
|
20
|
+
const [time, setTime] = useState(new Date());
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const interval = setInterval(() => {
|
|
24
|
+
setTime(new Date());
|
|
25
|
+
}, 1000);
|
|
26
|
+
|
|
27
|
+
return () => clearInterval(interval);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
19
30
|
if (!needRefresh) {
|
|
20
|
-
console.log("无需更新");
|
|
21
31
|
return null;
|
|
22
32
|
}
|
|
23
33
|
|
package/src/constants/routes.ts
CHANGED
package/src/main.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { ReloadPrompt } from "@/components";
|
|
|
6
6
|
import "@bbki.ng/components/style";
|
|
7
7
|
import App from "./app";
|
|
8
8
|
import "./main.css";
|
|
9
|
+
import Logger from "@/components/Logger";
|
|
9
10
|
|
|
10
11
|
const container = document.getElementById("root") as Element;
|
|
11
12
|
const root = createRoot(container);
|
|
@@ -15,6 +16,7 @@ root.render(
|
|
|
15
16
|
<Router>
|
|
16
17
|
<App />
|
|
17
18
|
<Toaster />
|
|
19
|
+
<Logger />
|
|
18
20
|
<ReloadPrompt />
|
|
19
21
|
</Router>
|
|
20
22
|
</React.StrictMode>
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CenterLinkList } from "@/components";
|
|
3
|
-
import { Footer } from "@/components/Footer";
|
|
4
3
|
|
|
5
4
|
export const Cover = (props: { className: string }) => {
|
|
6
5
|
return (
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/>
|
|
25
|
-
<Footer />
|
|
26
|
-
</div>
|
|
6
|
+
<CenterLinkList
|
|
7
|
+
links={[
|
|
8
|
+
{
|
|
9
|
+
to: "/projects",
|
|
10
|
+
name: "cd ./projects",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
to: "/blog",
|
|
14
|
+
name: "cd ./blog",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
to: "/now",
|
|
18
|
+
name: "cd ./now",
|
|
19
|
+
},
|
|
20
|
+
]}
|
|
21
|
+
title=" "
|
|
22
|
+
/>
|
|
27
23
|
);
|
|
28
24
|
};
|