@blocklet/ui-react 2.11.36 → 2.11.38

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.
@@ -33,10 +33,11 @@ const settingsLink = joinURL(PROFILE_URL, "/settings");
33
33
  const didSpacesLink = joinURL(PROFILE_URL, "/did-spaces");
34
34
  const Main = styled(Box)(({ theme }) => ({
35
35
  flex: 1,
36
+ boxSizing: "border-box",
37
+ padding: theme.spacing(3),
36
38
  width: "100%",
37
39
  maxWidth: 1200,
38
40
  margin: "0 auto",
39
- p: 3,
40
41
  display: "flex",
41
42
  alignItems: "stretch",
42
43
  gap: 2.5,
@@ -17,7 +17,7 @@ const hasNotification = () => {
17
17
  };
18
18
  export default function HeaderAddons({ formattedBlocklet, addons, sessionManagerProps }) {
19
19
  const sessionCtx = useContext(SessionContext);
20
- const { locale } = useLocaleContext() || {};
20
+ const { locale, languages } = useLocaleContext() || {};
21
21
  const { enableConnect = true, enableLocale = true } = formattedBlocklet;
22
22
  const authenticated = !!sessionCtx?.session?.user;
23
23
  let localizedNav = getLocalizedNavigation(formattedBlocklet?.navigation?.sessionManager, locale) || [];
@@ -30,7 +30,7 @@ export default function HeaderAddons({ formattedBlocklet, addons, sessionManager
30
30
  if (hasNotification()) {
31
31
  addonsArray.push(/* @__PURE__ */ jsx(NotificationAddon, { session: sessionCtx.session }, "notification-addon"));
32
32
  }
33
- if (enableLocale && locale) {
33
+ if (enableLocale && locale && languages.length > 1) {
34
34
  addonsArray.push(/* @__PURE__ */ jsx(LocaleSelector, { showText: false }, "locale-selector"));
35
35
  }
36
36
  if (enableConnect && sessionCtx) {
@@ -51,7 +51,6 @@ export default function NotificationAddon({ session = {} }) {
51
51
  variant: "outlined",
52
52
  href: viewAllUrl,
53
53
  sx: {
54
- borderRadius: 2,
55
54
  borderColor: colors.lineBorderStrong,
56
55
  "&:hover": {
57
56
  borderRadius: "50%"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.11.36",
3
+ "version": "2.11.38",
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.38",
36
- "@arcblock/bridge": "^2.11.36",
37
- "@arcblock/react-hooks": "^2.11.36",
36
+ "@arcblock/bridge": "^2.11.38",
37
+ "@arcblock/react-hooks": "^2.11.38",
38
38
  "@arcblock/ws": "^1.19.9",
39
39
  "@blocklet/did-space-react": "^1.0.15",
40
40
  "@iconify-icons/logos": "^1.2.36",
@@ -84,5 +84,5 @@
84
84
  "jest": "^29.7.0",
85
85
  "unbuild": "^2.0.0"
86
86
  },
87
- "gitHead": "43e4b6ab36c25fa46a52befc364971fd25f45767"
87
+ "gitHead": "76405cf15e46ac61b8fb61111579449a7f1ccd0f"
88
88
  }
@@ -41,10 +41,11 @@ const didSpacesLink = joinURL(PROFILE_URL, '/did-spaces');
41
41
 
42
42
  const Main = styled(Box)(({ theme }) => ({
43
43
  flex: 1,
44
+ boxSizing: 'border-box',
45
+ padding: theme.spacing(3),
44
46
  width: '100%',
45
47
  maxWidth: 1200,
46
48
  margin: '0 auto',
47
- p: 3,
48
49
  display: 'flex',
49
50
  alignItems: 'stretch',
50
51
  gap: 2.5,
@@ -21,7 +21,7 @@ const hasNotification = () => {
21
21
  // eslint-disable-next-line no-shadow
22
22
  export default function HeaderAddons({ formattedBlocklet, addons, sessionManagerProps }) {
23
23
  const sessionCtx = useContext(SessionContext);
24
- const { locale } = useLocaleContext() || {};
24
+ const { locale, languages } = useLocaleContext() || {};
25
25
  const { enableConnect = true, enableLocale = true } = formattedBlocklet;
26
26
  const authenticated = !!sessionCtx?.session?.user;
27
27
  let localizedNav = getLocalizedNavigation(formattedBlocklet?.navigation?.sessionManager, locale) || [];
@@ -38,8 +38,8 @@ export default function HeaderAddons({ formattedBlocklet, addons, sessionManager
38
38
  if (hasNotification()) {
39
39
  addonsArray.push(<NotificationAddon key="notification-addon" session={sessionCtx.session} />);
40
40
  }
41
- // 启用了多语言并且检测到了 locale context
42
- if (enableLocale && locale) {
41
+ // 启用了多语言,且检测到了 locale context,且有多种语言可以切换
42
+ if (enableLocale && locale && languages.length > 1) {
43
43
  addonsArray.push(<LocaleSelector key="locale-selector" showText={false} />);
44
44
  }
45
45
  // 启用了连接钱包并且检测到了 session context
@@ -61,7 +61,6 @@ export default function NotificationAddon({ session = {} }) {
61
61
  variant="outlined"
62
62
  href={viewAllUrl}
63
63
  sx={{
64
- borderRadius: 2,
65
64
  borderColor: colors.lineBorderStrong,
66
65
  '&:hover': {
67
66
  borderRadius: '50%',