@blocklet/ui-react 3.1.25 → 3.1.27
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/lib/@types/index.d.ts +1 -1
- package/lib/UserCenter/components/fallback.d.ts +8 -0
- package/lib/UserCenter/components/fallback.js +21 -0
- package/lib/UserCenter/components/user-center.js +205 -200
- package/lib/UserCenter/components/user-info/social-actions/chat.d.ts +5 -0
- package/lib/UserCenter/components/user-info/social-actions/chat.js +24 -0
- package/lib/UserCenter/components/user-info/social-actions/follow.d.ts +2 -0
- package/lib/UserCenter/components/user-info/social-actions/follow.js +19 -0
- package/lib/UserCenter/components/user-info/social-actions/index.d.ts +5 -0
- package/lib/UserCenter/components/user-info/social-actions/index.js +13 -0
- package/lib/UserCenter/components/user-info/user-basic-info.js +37 -35
- package/lib/UserCenter/libs/locales.d.ts +14 -0
- package/lib/UserCenter/libs/locales.js +16 -2
- package/lib/contexts/user-followers.d.ts +13 -0
- package/lib/contexts/user-followers.js +40 -0
- package/lib/hooks/use-follow.d.ts +12 -0
- package/lib/hooks/use-follow.js +47 -0
- package/package.json +6 -6
- package/src/@types/index.ts +1 -1
- package/src/UserCenter/components/fallback.tsx +51 -0
- package/src/UserCenter/components/user-center.tsx +22 -12
- package/src/UserCenter/components/user-info/social-actions/chat.tsx +42 -0
- package/src/UserCenter/components/user-info/social-actions/follow.tsx +30 -0
- package/src/UserCenter/components/user-info/social-actions/index.tsx +17 -0
- package/src/UserCenter/components/user-info/user-basic-info.tsx +6 -0
- package/src/UserCenter/libs/locales.ts +14 -0
- package/src/contexts/user-followers.tsx +54 -0
- package/src/hooks/use-follow.tsx +74 -0
package/lib/@types/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { UserCenterTab } from '../../@types';
|
|
3
|
+
declare function Fallback({ currentActiveTab, isMyself, children, }: {
|
|
4
|
+
currentActiveTab: UserCenterTab;
|
|
5
|
+
isMyself: boolean;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
8
|
+
export default Fallback;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import n from "@arcblock/ux/lib/Empty";
|
|
3
|
+
import { translate as c } from "@arcblock/ux/lib/Locale/util";
|
|
4
|
+
import { useMemoizedFn as d } from "ahooks";
|
|
5
|
+
import { useLocaleContext as u } from "@arcblock/ux/lib/Locale/context";
|
|
6
|
+
import { translations as a } from "../libs/locales.js";
|
|
7
|
+
import { useUserFollowersContext as w } from "../../contexts/user-followers.js";
|
|
8
|
+
function k({
|
|
9
|
+
currentActiveTab: o,
|
|
10
|
+
isMyself: m,
|
|
11
|
+
children: l
|
|
12
|
+
}) {
|
|
13
|
+
const { locale: f } = u(), r = d((s, p = {}) => c(a, s, f, "en", p)), { followed: i } = w();
|
|
14
|
+
if (m || !o?.protected || o?.protected === "all")
|
|
15
|
+
return l;
|
|
16
|
+
const { protected: t } = o;
|
|
17
|
+
return t === !0 || t === "private" ? /* @__PURE__ */ e(n, { children: r("underProtected") }) : t === "follower-only" ? i ? l : /* @__PURE__ */ e(n, { children: r("followersOnly") }) : /* @__PURE__ */ e(n, { children: r("underProtected") });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
k as default
|
|
21
|
+
};
|