@blocklet/ui-react 2.12.48 → 2.12.49

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.
@@ -8,6 +8,7 @@ import SessionUser from "@arcblock/ux/lib/SessionUser";
8
8
  import SessionBlocklet from "@arcblock/ux/lib/SessionBlocklet";
9
9
  import LocaleSelector from "@arcblock/ux/lib/Locale/selector";
10
10
  import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
11
+ import ThemeModeToggle from "@arcblock/ux/lib/Config/theme-mode-toggle";
11
12
  import { SessionManagerProps } from "../types.js";
12
13
  import { getLocalizedNavigation, filterNavByRole } from "../blocklets.js";
13
14
  import NotificationAddon from "./notification-addon.js";
@@ -34,6 +35,9 @@ export default function HeaderAddons({ formattedBlocklet, addons, showDomainWarn
34
35
  if (enableLocale && locale && languages.length > 1) {
35
36
  addonsArray.push(/* @__PURE__ */ jsx(LocaleSelector, { showText: false }, "locale-selector"));
36
37
  }
38
+ if (window.blocklet?.USE_DARK_THEME) {
39
+ addonsArray.push(/* @__PURE__ */ jsx(ThemeModeToggle, {}, "theme-mode-toggle"));
40
+ }
37
41
  if (enableConnect && sessionCtx) {
38
42
  const menu = [];
39
43
  if (authenticated) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.12.48",
3
+ "version": "2.12.49",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@abtnode/constant": "^1.16.40",
36
- "@arcblock/bridge": "^2.12.48",
37
- "@arcblock/react-hooks": "^2.12.48",
36
+ "@arcblock/bridge": "^2.12.49",
37
+ "@arcblock/react-hooks": "^2.12.49",
38
38
  "@arcblock/ws": "^1.19.15",
39
39
  "@blocklet/did-space-react": "^1.0.37",
40
40
  "@iconify-icons/logos": "^1.2.36",
@@ -87,5 +87,5 @@
87
87
  "jest": "^29.7.0",
88
88
  "unbuild": "^2.0.0"
89
89
  },
90
- "gitHead": "ebd5382e37f7ac4310d23e3ff82d95fcfc8a6628"
90
+ "gitHead": "ffebc9c5df6d576f08c3538b4db75d7ec8cf00be"
91
91
  }
@@ -9,6 +9,8 @@ import SessionUser from '@arcblock/ux/lib/SessionUser';
9
9
  import SessionBlocklet from '@arcblock/ux/lib/SessionBlocklet';
10
10
  import LocaleSelector from '@arcblock/ux/lib/Locale/selector';
11
11
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
12
+ import ThemeModeToggle from '@arcblock/ux/lib/Config/theme-mode-toggle';
13
+
12
14
  import { SessionManagerProps } from '../types';
13
15
  import { getLocalizedNavigation, filterNavByRole } from '../blocklets';
14
16
  import NotificationAddon from './notification-addon';
@@ -45,6 +47,11 @@ export default function HeaderAddons({ formattedBlocklet, addons, showDomainWarn
45
47
  addonsArray.push(<LocaleSelector key="locale-selector" showText={false} />);
46
48
  }
47
49
 
50
+ // 启用了黑夜主题
51
+ if (window.blocklet?.USE_DARK_THEME) {
52
+ addonsArray.push(<ThemeModeToggle key="theme-mode-toggle" />);
53
+ }
54
+
48
55
  // 启用了连接钱包并且检测到了 session context
49
56
  if (enableConnect && sessionCtx) {
50
57
  const menu = [];