@blocklet/ui-react 3.1.39 → 3.1.41

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.
@@ -7,15 +7,15 @@ import { translate as f } from "@arcblock/ux/lib/Locale/util";
7
7
  import { useLocaleContext as p } from "@arcblock/ux/lib/Locale/context";
8
8
  import { joinURL as h } from "ufo";
9
9
  import { translations as g } from "../../../libs/locales.js";
10
- const M = () => {
10
+ const x = () => {
11
11
  const { componentMountPoints: o = [] } = window.blocklet || {};
12
12
  return o.find((t) => t.name === "did-comments")?.mountPoint;
13
13
  };
14
14
  function L({ user: o }) {
15
- const { locale: n } = p(), t = r((m, s = {}) => f(g, m, n, "en", s)), i = l(() => M(), []), e = r(() => {
15
+ const { locale: n } = p(), t = r((m, s = {}) => f(g, m, n, "en", s)), i = l(() => x(), []), e = r(() => {
16
16
  window.open(h(i, `/chat/dm/${o?.did}`), "_blank");
17
17
  });
18
- return i ? /* @__PURE__ */ c(u, { fullWidth: !0, variant: "outlined", color: "inherit", onClick: e, children: [
18
+ return i ? /* @__PURE__ */ c(u, { fullWidth: !0, variant: "outlined", color: "inherit", onClick: e, sx: { borderColor: "divider" }, children: [
19
19
  /* @__PURE__ */ a(d, { icon: "tabler:message-dots", style: { marginRight: 4 } }),
20
20
  t("profile.chat")
21
21
  ] }) : null;
@@ -1,19 +1,14 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import { Button as s } from "@mui/material";
3
- import { useMemoizedFn as p } from "ahooks";
4
- import { translate as a } from "@arcblock/ux/lib/Locale/util";
5
- import { useLocaleContext as c } from "@arcblock/ux/lib/Locale/context";
6
- import u from "@mui/icons-material/Notifications";
7
- import x from "@mui/icons-material/NotificationsOff";
8
- import { translations as w } from "../../../libs/locales.js";
9
- import { useUserFollowersContext as d } from "../../../../contexts/user-followers.js";
10
- function R() {
11
- const { locale: i } = c(), t = p((l, f = {}) => a(w, l, i, "en", f)), { followed: o, followUser: n, unfollowUser: e } = d();
12
- return /* @__PURE__ */ m(s, { variant: "contained", onClick: () => o ? e() : n(), fullWidth: !0, children: [
13
- o ? /* @__PURE__ */ r(x, { sx: { fontSize: "14px", marginRight: "4px" } }) : /* @__PURE__ */ r(u, { sx: { fontSize: "14px", marginRight: "4px" } }),
14
- t(o ? "profile.unfollow" : "profile.follow")
15
- ] });
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Button as m } from "@mui/material";
3
+ import { useMemoizedFn as s } from "ahooks";
4
+ import { translate as u } from "@arcblock/ux/lib/Locale/util";
5
+ import { useLocaleContext as a } from "@arcblock/ux/lib/Locale/context";
6
+ import { translations as p } from "../../../libs/locales.js";
7
+ import { useUserFollowersContext as c } from "../../../../contexts/user-followers.js";
8
+ function j() {
9
+ const { locale: t } = a(), o = s((n, f = {}) => u(p, n, t, "en", f)), { followed: r, followUser: l, unfollowUser: e } = c();
10
+ return /* @__PURE__ */ i(m, { variant: "contained", onClick: () => r ? e() : l(), fullWidth: !0, children: o(r ? "profile.unfollow" : "profile.follow") });
16
11
  }
17
12
  export {
18
- R as default
13
+ j as default
19
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "3.1.39",
3
+ "version": "3.1.41",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -35,9 +35,9 @@
35
35
  "dependencies": {
36
36
  "@abtnode/constant": "^1.16.49-beta-20250823-082650-626c1473",
37
37
  "@abtnode/util": "^1.16.49-beta-20250823-082650-626c1473",
38
- "@arcblock/bridge": "3.1.39",
39
- "@arcblock/icons": "3.1.39",
40
- "@arcblock/react-hooks": "3.1.39",
38
+ "@arcblock/bridge": "3.1.41",
39
+ "@arcblock/icons": "3.1.41",
40
+ "@arcblock/react-hooks": "3.1.41",
41
41
  "@arcblock/ws": "^1.21.3",
42
42
  "@blocklet/constant": "^1.16.49-beta-20250823-082650-626c1473",
43
43
  "@blocklet/did-space-react": "^1.1.16",
@@ -83,7 +83,7 @@
83
83
  "access": "public"
84
84
  },
85
85
  "devDependencies": {
86
- "@arcblock/did-connect-react": "3.1.39",
86
+ "@arcblock/did-connect-react": "3.1.41",
87
87
  "@types/dompurify": "^3.2.0",
88
88
  "@types/ua-parser-js": "^0.7.39",
89
89
  "@types/validator": "^13.15.2",
@@ -91,5 +91,5 @@
91
91
  "jest": "^29.7.0",
92
92
  "unbuild": "^2.0.0"
93
93
  },
94
- "gitHead": "39e8ff533f71280af4170866de8055a188c820ba"
94
+ "gitHead": "21979ee3abb716f0201960abe9c85d8f0a8f291c"
95
95
  }
@@ -33,7 +33,7 @@ function Chat({ user }: { user: User }) {
33
33
  }
34
34
 
35
35
  return (
36
- <Button fullWidth variant="outlined" color="inherit" onClick={onNavigateToChat}>
36
+ <Button fullWidth variant="outlined" color="inherit" onClick={onNavigateToChat} sx={{ borderColor: 'divider' }}>
37
37
  <Icon icon="tabler:message-dots" style={{ marginRight: 4 }} />
38
38
  {t('profile.chat')}
39
39
  </Button>
@@ -2,8 +2,6 @@ import { Button } from '@mui/material';
2
2
  import { useMemoizedFn } from 'ahooks';
3
3
  import { translate } from '@arcblock/ux/lib/Locale/util';
4
4
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
5
- import NotificationsIcon from '@mui/icons-material/Notifications';
6
- import NotificationsOffIcon from '@mui/icons-material/NotificationsOff';
7
5
 
8
6
  import { translations } from '../../../libs/locales';
9
7
  import { useUserFollowersContext } from '../../../../contexts/user-followers';
@@ -17,11 +15,6 @@ function Follow() {
17
15
 
18
16
  return (
19
17
  <Button variant="contained" onClick={() => (followed ? unfollowUser() : followUser())} fullWidth>
20
- {followed ? (
21
- <NotificationsOffIcon sx={{ fontSize: '14px', marginRight: '4px' }} />
22
- ) : (
23
- <NotificationsIcon sx={{ fontSize: '14px', marginRight: '4px' }} />
24
- )}
25
18
  {followed ? t('profile.unfollow') : t('profile.follow')}
26
19
  </Button>
27
20
  );