@bbki.ng/site 1.5.8 → 1.5.10

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
@@ -1,5 +1,9 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 1.5.10
4
+
5
+ ## 1.5.9
6
+
3
7
  ## 1.5.8
4
8
 
5
9
  ## 1.5.7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
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.4.7",
19
+ "@bbki.ng/components": "workspace:2.4.8",
20
20
  "@supabase/supabase-js": "^1.35.4",
21
21
  "classnames": "2.3.1",
22
22
  "react": "^18.0.0",
@@ -28,7 +28,7 @@
28
28
  "swr": "^2.2.5"
29
29
  },
30
30
  "devDependencies": {
31
- "@bbki.ng/stylebase": "workspace:0.3.7",
31
+ "@bbki.ng/stylebase": "workspace:0.3.8",
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",
package/src/app.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from "react";
2
- import { Routes, Route, Outlet } from "react-router-dom";
3
- import { Nav, Page, NotFound } from "@bbki.ng/components";
4
- import { HotKeyNav, Stickers } from "./components";
2
+ import { Outlet, Route, Routes } from "react-router-dom";
3
+ import { Nav, NotFound, Page } from "@bbki.ng/components";
4
+ import { HotKeyNav } from "./components";
5
5
  import { threeColWrapper } from "@/components/with_wrapper";
6
6
  import { Cover } from "./pages";
7
7
 
@@ -22,9 +22,13 @@ import {
22
22
  } from "@/global_loading_state_provider";
23
23
  import { UploadPage } from "@/pages/upload";
24
24
  import { AppCtxMenu } from "@/components/app_ctx_menu";
25
+ import { Pochacco } from "@/components/Pochacco";
26
+ import { Role, useRole } from "@/hooks/use_role";
25
27
 
26
28
  const Layout = () => {
27
29
  const { isLoading } = useContext(GlobalLoadingContext);
30
+ const role = useRole();
31
+ const isQueen = role === Role.QUEEN;
28
32
  return (
29
33
  <>
30
34
  <Page
@@ -34,6 +38,7 @@ const Layout = () => {
34
38
  paths={usePaths()}
35
39
  className="blur-cover select-none"
36
40
  loading={isLoading}
41
+ customLogo={isQueen ? <Pochacco /> : null}
37
42
  />
38
43
  </AppCtxMenu>
39
44
  }
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: ""
2
+ title: "近况"
3
3
  ---
4
4
 
5
5
  import { MovieList } from "@/components/movie_list";
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+
3
+ export const Pochacco = () => {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ version="1.0"
8
+ width="48"
9
+ height="48"
10
+ viewBox="0 0 256.000000 256.000000"
11
+ preserveAspectRatio="xMidYMid meet"
12
+ >
13
+ <g
14
+ transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"
15
+ fill="#000000"
16
+ stroke="none"
17
+ >
18
+ <path d="M348 2063 c-17 -43 -14 -218 5 -284 36 -120 150 -281 231 -324 20 -11 36 -22 36 -26 0 -3 -9 -31 -20 -63 -29 -84 -43 -208 -35 -306 9 -107 18 -132 47 -128 22 3 22 6 23 173 1 151 3 177 24 235 52 144 141 249 251 297 93 40 105 48 105 68 0 17 -7 20 -41 19 -75 -1 -196 -76 -271 -166 l-32 -39 -5 33 c-3 18 -11 62 -16 98 -27 161 -97 294 -215 402 -48 45 -71 48 -87 11z m82 -104 c0 -11 -4 -17 -10 -14 -5 3 -10 13 -10 21 0 8 5 14 10 14 6 0 10 -9 10 -21z m70 -60 c7 -11 9 -27 6 -36 -9 -22 -36 3 -36 33 0 30 16 31 30 3z m68 -124 c14 -30 16 -55 5 -55 -18 1 -31 17 -38 48 -8 40 16 45 33 7z m-58 -69 c4 -11 5 -25 3 -29 -7 -12 -32 24 -33 46 0 23 19 12 30 -17z m114 -132 c4 -9 4 -19 2 -21 -8 -8 -26 8 -26 23 0 19 16 18 24 -2z" />
19
+ <path d="M1088 1889 c-30 -17 -20 -37 34 -74 63 -42 78 -44 78 -10 0 71 -59 115 -112 84z" />
20
+ <path d="M1329 1841 c-61 -60 -47 -95 29 -73 20 6 56 16 80 22 50 13 56 38 16 69 -42 33 -80 27 -125 -18z" />
21
+ <path d="M956 1839 c-14 -11 -26 -27 -26 -35 0 -8 34 -31 75 -51 67 -33 77 -36 90 -22 28 28 -53 129 -104 129 -5 0 -20 -9 -35 -21z" />
22
+ <path d="M1342 1705 c3 -25 9 -30 53 -40 117 -26 236 -117 287 -221 58 -115 70 -169 76 -342 l5 -163 26 3 26 3 0 176 0 176 40 -41 c71 -73 201 -149 329 -192 82 -28 102 -30 110 -8 25 65 -20 159 -145 305 -62 71 -150 119 -284 153 -129 32 -190 59 -242 107 -60 55 -156 100 -226 107 l-59 5 4 -28z m512 -286 c31 -36 33 -49 8 -49 -10 0 -25 13 -35 29 -33 56 -15 70 27 20z m174 -76 c5 -18 -23 -16 -39 3 -11 14 -10 15 11 12 13 -1 25 -9 28 -15z m76 -59 c22 -9 20 -34 -3 -34 -21 0 -45 23 -34 33 8 9 17 9 37 1z m-59 -55 c10 -31 0 -33 -31 -5 l-29 25 27 1 c18 0 29 -6 33 -21z m155 -61 c0 -13 -27 -9 -40 7 -19 23 -1 39 21 19 10 -9 19 -21 19 -26z" />
23
+ <path d="M880 941 c-17 -32 -12 -89 10 -111 34 -34 80 -2 80 58 0 49 -16 72 -50 72 -19 0 -33 -7 -40 -19z" />
24
+ <path d="M1470 941 c-5 -11 -10 -34 -10 -51 0 -47 16 -70 50 -70 34 0 50 23 50 70 0 47 -16 70 -50 70 -19 0 -33 -7 -40 -19z" />
25
+ <path d="M592 897 c-86 -92 -63 -258 49 -347 96 -76 220 -107 464 -116 453 -17 694 64 744 251 22 81 7 161 -39 207 -34 33 -46 35 -60 7 -9 -16 -8 -24 4 -38 31 -35 45 -84 36 -131 -5 -25 -9 -48 -10 -52 0 -5 -17 -27 -37 -50 -43 -47 -128 -89 -218 -108 -142 -30 -534 -27 -668 4 -115 27 -196 78 -231 146 -32 62 -26 134 15 189 14 17 16 28 8 42 -13 25 -31 24 -57 -4z" />
26
+ <path d="M1162 824 c-40 -28 -19 -74 41 -89 58 -15 105 57 60 91 -24 18 -74 17 -101 -2z" />
27
+ </g>
28
+ </svg>
29
+ );
30
+ };
@@ -10,6 +10,7 @@ import { useNavigate, useParams } from "react-router-dom";
10
10
  import { useDelPost } from "@/hooks/use_delete_post";
11
11
  import { toast } from "sonner";
12
12
  import { confirm } from "@/utils";
13
+ import { useLoadingIndicator } from "@/hooks/useLoadingIndicator";
13
14
 
14
15
  export const ArticleCtxMenu = (props: { children: ReactElement }) => {
15
16
  const auth = useAuthed();
@@ -17,6 +18,7 @@ export const ArticleCtxMenu = (props: { children: ReactElement }) => {
17
18
  const routeParams = useParams();
18
19
  const nav = useNavigate();
19
20
  const title = routeParams.title;
21
+ const dot = useLoadingIndicator();
20
22
 
21
23
  if (!auth) {
22
24
  return props.children;
@@ -27,11 +29,13 @@ export const ArticleCtxMenu = (props: { children: ReactElement }) => {
27
29
  }
28
30
 
29
31
  const doDel = useCallback(() => {
32
+ dot.setVisibility(true);
30
33
  del(title)
31
34
  .then(() => {
32
35
  toast.success("删除成功", {
33
36
  position: "top-center",
34
37
  });
38
+ dot.setVisibility(false);
35
39
  nav("/blog");
36
40
  })
37
41
  .catch(console.log);
@@ -0,0 +1,11 @@
1
+ import { GlobalLoadingContext } from "@/global_loading_state_provider";
2
+ import { useContext } from "react";
3
+
4
+ export const useLoadingIndicator = () => {
5
+ const globalCtx = useContext(GlobalLoadingContext);
6
+
7
+ return {
8
+ setVisibility: globalCtx.setIsLoading,
9
+ isVisible: globalCtx.isLoading,
10
+ };
11
+ };