@blocklet/ui-react 2.13.12 → 2.13.14
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/ComponentInstaller/index.js +6 -7
- package/lib/ComponentInstaller/installer-item.js +6 -6
- package/lib/Dashboard/index.js +6 -4
- package/lib/Footer/index.js +9 -5
- package/lib/Footer/links.js +1 -1
- package/lib/Footer/social-media.js +3 -12
- package/lib/Header/index.js +7 -6
- package/lib/Notifications/hooks/use-title.js +7 -5
- package/lib/UserCenter/components/config-profile.js +2 -3
- package/lib/UserCenter/components/editable-field.d.ts +2 -0
- package/lib/UserCenter/components/editable-field.js +4 -5
- package/lib/UserCenter/components/nft.js +3 -4
- package/lib/UserCenter/components/notification.js +4 -7
- package/lib/UserCenter/components/passport.js +3 -6
- package/lib/UserCenter/components/settings.js +4 -4
- package/lib/UserCenter/components/status-dialog/index.js +4 -5
- package/lib/UserCenter/components/status-selector/duration-menu.d.ts +1 -3
- package/lib/UserCenter/components/status-selector/duration-menu.js +2 -4
- package/lib/UserCenter/components/status-selector/menu-item.d.ts +1 -3
- package/lib/UserCenter/components/status-selector/menu-item.js +2 -4
- package/lib/UserCenter/components/third-party-login/index.js +3 -1
- package/lib/UserCenter/components/third-party-login/third-party-item.js +21 -17
- package/lib/UserCenter/components/user-center.js +6 -7
- package/lib/UserCenter/components/user-info/address.js +2 -3
- package/lib/UserCenter/components/user-info/link-preview-input.js +8 -8
- package/lib/UserCenter/components/user-info/metadata.js +1 -1
- package/lib/UserCenter/components/user-info/switch-role.js +5 -8
- package/lib/UserCenter/components/user-info/timezone-select.js +13 -8
- package/lib/UserCenter/components/user-info/user-basic-info.js +3 -4
- package/lib/UserCenter/components/user-info/user-info-item.js +2 -3
- package/lib/UserCenter/components/user-info/utils.d.ts +2 -2
- package/lib/UserCenter/components/user-info/utils.js +12 -13
- package/lib/UserCenter/components/webhook-item.js +16 -13
- package/lib/UserSessions/components/user-session-info.js +2 -3
- package/lib/UserSessions/components/user-sessions.js +9 -6
- package/lib/common/header-addons.js +1 -1
- package/lib/hooks/use-blocklet-logo.d.ts +8 -0
- package/lib/hooks/use-blocklet-logo.js +23 -0
- package/package.json +5 -5
- package/src/ComponentInstaller/index.jsx +7 -7
- package/src/ComponentInstaller/installer-item.jsx +6 -6
- package/src/Dashboard/index.jsx +6 -4
- package/src/Footer/index.jsx +9 -5
- package/src/Footer/links.jsx +1 -1
- package/src/Footer/social-media.jsx +3 -9
- package/src/Header/index.tsx +7 -6
- package/src/Notifications/hooks/use-title.tsx +8 -5
- package/src/UserCenter/components/config-profile.tsx +2 -3
- package/src/UserCenter/components/editable-field.tsx +6 -5
- package/src/UserCenter/components/nft.tsx +3 -4
- package/src/UserCenter/components/notification.tsx +4 -7
- package/src/UserCenter/components/passport.tsx +3 -7
- package/src/UserCenter/components/settings.tsx +4 -4
- package/src/UserCenter/components/status-dialog/index.tsx +4 -5
- package/src/UserCenter/components/status-selector/duration-menu.tsx +2 -4
- package/src/UserCenter/components/status-selector/menu-item.tsx +2 -4
- package/src/UserCenter/components/third-party-login/index.tsx +18 -14
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +22 -17
- package/src/UserCenter/components/user-center.tsx +6 -7
- package/src/UserCenter/components/user-info/address.tsx +3 -3
- package/src/UserCenter/components/user-info/link-preview-input.tsx +9 -10
- package/src/UserCenter/components/user-info/metadata.tsx +1 -1
- package/src/UserCenter/components/user-info/switch-role.tsx +6 -9
- package/src/UserCenter/components/user-info/timezone-select.tsx +12 -9
- package/src/UserCenter/components/user-info/user-basic-info.tsx +3 -4
- package/src/UserCenter/components/user-info/user-info-item.tsx +2 -3
- package/src/UserCenter/components/user-info/utils.ts +13 -13
- package/src/UserCenter/components/webhook-item.tsx +16 -13
- package/src/UserSessions/components/user-session-info.tsx +2 -3
- package/src/UserSessions/components/user-sessions.tsx +9 -5
- package/src/common/header-addons.jsx +2 -2
- package/src/hooks/use-blocklet-logo.tsx +32 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SessionContext } from "@arcblock/did-connect/lib/Session";
|
|
3
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
4
3
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
5
4
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
6
5
|
import SessionPermission from "@arcblock/ux/lib/SessionPermission";
|
|
@@ -80,14 +79,14 @@ function ComponentInstaller({
|
|
|
80
79
|
top: 20,
|
|
81
80
|
right: 20,
|
|
82
81
|
zIndex: 3e3,
|
|
83
|
-
borderRadius:
|
|
82
|
+
borderRadius: 1.5,
|
|
84
83
|
width: 400,
|
|
85
84
|
maxWidth: "90vw",
|
|
86
|
-
borderColor:
|
|
85
|
+
borderColor: "divider",
|
|
87
86
|
border: "0 !important",
|
|
88
87
|
fontSize: "14px",
|
|
89
88
|
textAlign: "left",
|
|
90
|
-
boxShadow: `0px 8px 16px 0px ${
|
|
89
|
+
boxShadow: ({ palette }) => `0px 8px 16px 0px ${palette.grey[100]}, 0px 0px 0px 1px ${palette.grey[100]}`
|
|
91
90
|
},
|
|
92
91
|
children: !definedInBlockletYML ? /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column" }, children: [
|
|
93
92
|
/* @__PURE__ */ jsxs(
|
|
@@ -109,7 +108,7 @@ function ComponentInstaller({
|
|
|
109
108
|
]
|
|
110
109
|
}
|
|
111
110
|
),
|
|
112
|
-
/* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor:
|
|
111
|
+
/* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
|
|
113
112
|
/* @__PURE__ */ jsxs(Box, { sx: { padding: "20px 24px", marginTop: 0 }, children: [
|
|
114
113
|
t("componentInstallerNoDefinedInBlockletYML"),
|
|
115
114
|
": ",
|
|
@@ -135,7 +134,7 @@ function ComponentInstaller({
|
|
|
135
134
|
]
|
|
136
135
|
}
|
|
137
136
|
),
|
|
138
|
-
/* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor:
|
|
137
|
+
/* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
|
|
139
138
|
/* @__PURE__ */ jsx(Box, { sx: { maxHeight: "70vh", overflowY: "auto" }, children: optComponents.map((optionalComponent, index) => {
|
|
140
139
|
return /* @__PURE__ */ jsx(
|
|
141
140
|
InstallerItem,
|
|
@@ -150,7 +149,7 @@ function ComponentInstaller({
|
|
|
150
149
|
);
|
|
151
150
|
}) }),
|
|
152
151
|
hasPermission ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
153
|
-
/* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor:
|
|
152
|
+
/* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
|
|
154
153
|
/* @__PURE__ */ jsx(Box, { sx: { padding: "20px 24px" }, children: /* @__PURE__ */ jsx(Box, { sx: { opacity: 1 }, children: t("componentInstallerSuggestions") }) })
|
|
155
154
|
] })
|
|
156
155
|
] })
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
3
2
|
import { Icon } from "@iconify/react";
|
|
4
|
-
import { Box, Button } from "@mui/material";
|
|
3
|
+
import { Box, Button, useTheme } from "@mui/material";
|
|
5
4
|
import PropTypes from "prop-types";
|
|
6
5
|
export default function InstallerItem({ optionalComponent, index, installStatus, hasPermission, t }) {
|
|
6
|
+
const { palette } = useTheme();
|
|
7
7
|
const handleInstall = () => {
|
|
8
8
|
window.open(optionalComponent?.installUrl, "_blank");
|
|
9
9
|
};
|
|
@@ -16,7 +16,7 @@ export default function InstallerItem({ optionalComponent, index, installStatus,
|
|
|
16
16
|
const installStatusDone = installStatus === "stopped" || installStatus === "running";
|
|
17
17
|
const size = 60;
|
|
18
18
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
19
|
-
index === 0 ? null : /* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor:
|
|
19
|
+
index === 0 ? null : /* @__PURE__ */ jsx(Box, { sx: { width: "100%", height: "1px", backgroundColor: "grey.100" } }),
|
|
20
20
|
/* @__PURE__ */ jsxs(
|
|
21
21
|
Box,
|
|
22
22
|
{
|
|
@@ -83,7 +83,7 @@ export default function InstallerItem({ optionalComponent, index, installStatus,
|
|
|
83
83
|
className: "link-icon",
|
|
84
84
|
icon: "fluent:open-20-filled",
|
|
85
85
|
style: {
|
|
86
|
-
color:
|
|
86
|
+
color: palette.primary.main,
|
|
87
87
|
fontSize: 16,
|
|
88
88
|
transform: "translate(6px, 3px)",
|
|
89
89
|
transition: "all 0.3s"
|
|
@@ -101,8 +101,8 @@ export default function InstallerItem({ optionalComponent, index, installStatus,
|
|
|
101
101
|
Button,
|
|
102
102
|
{
|
|
103
103
|
disabled: true,
|
|
104
|
-
sx: { color: "
|
|
105
|
-
startIcon: /* @__PURE__ */ jsx(Icon, { icon: "line-md:loading-loop", style: { color: "
|
|
104
|
+
sx: { color: "text.primary" },
|
|
105
|
+
startIcon: /* @__PURE__ */ jsx(Icon, { icon: "line-md:loading-loop", style: { color: "text.primary", fontSize: 16 } }),
|
|
106
106
|
variant: "contained",
|
|
107
107
|
children: installStatus
|
|
108
108
|
},
|
package/lib/Dashboard/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { mapRecursive, flatRecursive, matchPaths } from "../utils.js";
|
|
|
11
11
|
import { publicPath, formatBlockletInfo, getLocalizedNavigation, filterNavByRole } from "../blocklets.js";
|
|
12
12
|
import HeaderAddons from "../common/header-addons.js";
|
|
13
13
|
import { useWalletHiddenTopbar } from "../common/wallet-hidden-topbar.js";
|
|
14
|
-
import
|
|
14
|
+
import useBlockletLogo from "../hooks/use-blocklet-logo.js";
|
|
15
15
|
function Dashboard({
|
|
16
16
|
meta,
|
|
17
17
|
fallbackUrl,
|
|
@@ -27,7 +27,6 @@ function Dashboard({
|
|
|
27
27
|
const user = sessionCtx?.session?.user;
|
|
28
28
|
const userRole = user?.role;
|
|
29
29
|
const { locale } = useLocaleContext() || {};
|
|
30
|
-
const isMobile = useMobile();
|
|
31
30
|
const formattedBlocklet = useMemo(() => {
|
|
32
31
|
const blocklet = Object.assign({}, window.blocklet, meta);
|
|
33
32
|
try {
|
|
@@ -71,6 +70,9 @@ function Dashboard({
|
|
|
71
70
|
return { localizedNav: localizedNav2, flattened: flattened2, matchedIndex: matchedIndex2 };
|
|
72
71
|
}, [formattedBlocklet, locale, userRole]);
|
|
73
72
|
const allLinks = typeof links === "function" ? links(localizedNav) : [...localizedNav, ...links];
|
|
73
|
+
const appLogo = useBlockletLogo({
|
|
74
|
+
meta
|
|
75
|
+
});
|
|
74
76
|
useLayoutEffect(() => {
|
|
75
77
|
if (!!user && !flattened?.length && fallbackUrl) {
|
|
76
78
|
window.location.href = fallbackUrl;
|
|
@@ -87,7 +89,7 @@ function Dashboard({
|
|
|
87
89
|
if (!formattedBlocklet.appName) {
|
|
88
90
|
return null;
|
|
89
91
|
}
|
|
90
|
-
const {
|
|
92
|
+
const { appName } = formattedBlocklet;
|
|
91
93
|
const _headerAddons = /* @__PURE__ */ jsx(
|
|
92
94
|
HeaderAddons,
|
|
93
95
|
{
|
|
@@ -108,7 +110,7 @@ function Dashboard({
|
|
|
108
110
|
...rest,
|
|
109
111
|
headerProps: {
|
|
110
112
|
homeLink: publicPath,
|
|
111
|
-
logo: /* @__PURE__ */ jsx("img", { src:
|
|
113
|
+
logo: /* @__PURE__ */ jsx("img", { src: appLogo, alt: "logo" }),
|
|
112
114
|
addons: _headerAddons,
|
|
113
115
|
...rest.headerProps
|
|
114
116
|
}
|
package/lib/Footer/index.js
CHANGED
|
@@ -5,13 +5,13 @@ import { styled, useTheme, deepmerge, ThemeProvider } from "@arcblock/ux/lib/The
|
|
|
5
5
|
import { withErrorBoundary } from "react-error-boundary";
|
|
6
6
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
7
7
|
import { ErrorFallback } from "@arcblock/ux/lib/ErrorBoundary";
|
|
8
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
9
8
|
import omit from "lodash/omit";
|
|
10
9
|
import InternalFooter from "./internal-footer.js";
|
|
11
10
|
import { mapRecursive } from "../utils.js";
|
|
12
11
|
import { formatBlockletInfo, getLocalizedNavigation } from "../blocklets.js";
|
|
13
12
|
import { BlockletMetaProps } from "../types.js";
|
|
14
13
|
import withHideWhenEmbed from "../libs/with-hide-when-embed.js";
|
|
14
|
+
import useBlockletLogo from "../hooks/use-blocklet-logo.js";
|
|
15
15
|
function Footer({ meta, theme: themeOverrides, ...rest }) {
|
|
16
16
|
const { locale } = useLocaleContext() || {};
|
|
17
17
|
const parentTheme = useTheme();
|
|
@@ -25,10 +25,14 @@ function Footer({ meta, theme: themeOverrides, ...rest }) {
|
|
|
25
25
|
}
|
|
26
26
|
}, [meta]);
|
|
27
27
|
const mergeTheme = useMemo(() => deepmerge(parentTheme, themeOverrides), [parentTheme, themeOverrides]);
|
|
28
|
+
const appLogo = useBlockletLogo({
|
|
29
|
+
meta,
|
|
30
|
+
theme: themeOverrides
|
|
31
|
+
});
|
|
28
32
|
if (!formattedBlocklet.appName) {
|
|
29
33
|
return null;
|
|
30
34
|
}
|
|
31
|
-
const {
|
|
35
|
+
const { appName, appDescription, description, copyright } = formattedBlocklet;
|
|
32
36
|
const $bgColor = mergeTheme.palette.background.default;
|
|
33
37
|
const localized = {
|
|
34
38
|
footerNav: getLocalizedNavigation(formattedBlocklet?.navigation?.footer, locale) || [],
|
|
@@ -39,7 +43,7 @@ function Footer({ meta, theme: themeOverrides, ...rest }) {
|
|
|
39
43
|
brand: {
|
|
40
44
|
name: appName,
|
|
41
45
|
description: appDescription || description,
|
|
42
|
-
logo:
|
|
46
|
+
logo: appLogo
|
|
43
47
|
},
|
|
44
48
|
navigation: mapRecursive(
|
|
45
49
|
localized.footerNav,
|
|
@@ -66,8 +70,8 @@ Footer.defaultProps = {
|
|
|
66
70
|
theme: null
|
|
67
71
|
};
|
|
68
72
|
const StyledInternalFooter = styled(InternalFooter)`
|
|
69
|
-
${({ $bordered }) => `border-top: 1px solid ${$bordered
|
|
70
|
-
color: ${(
|
|
73
|
+
${({ $bordered, theme }) => `border-top: 1px solid ${$bordered && theme.palette.divider};`}
|
|
74
|
+
color: ${({ theme }) => theme.palette.grey[400]};
|
|
71
75
|
${({ $bgcolor }) => $bgcolor && `background-color: ${$bgcolor};`}
|
|
72
76
|
`;
|
|
73
77
|
export default withErrorBoundary(withHideWhenEmbed(Footer), {
|
package/lib/Footer/links.js
CHANGED
|
@@ -128,7 +128,7 @@ Links.defaultProps = {
|
|
|
128
128
|
};
|
|
129
129
|
const Root = styled("div")`
|
|
130
130
|
overflow: hidden;
|
|
131
|
-
color: ${({ theme }) => theme.palette.grey[
|
|
131
|
+
color: ${({ theme }) => theme.palette.grey[400]};
|
|
132
132
|
.footer-links-inner {
|
|
133
133
|
display: flex;
|
|
134
134
|
justify-content: space-between;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import {
|
|
3
|
+
import { styled } from "@arcblock/ux/lib/Theme";
|
|
4
4
|
import Icon from "../Icon/index.js";
|
|
5
5
|
export default function SocialMedia({ items, ...rest }) {
|
|
6
|
-
const theme = useTheme();
|
|
7
6
|
if (!items?.length) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
@@ -15,15 +14,7 @@ export default function SocialMedia({ items, ...rest }) {
|
|
|
15
14
|
target: "_blank",
|
|
16
15
|
"aria-label": `Social media icon${item.title ? ` for ${item.title}` : ""}`,
|
|
17
16
|
rel: "noreferrer",
|
|
18
|
-
children: /* @__PURE__ */ jsx(
|
|
19
|
-
Icon,
|
|
20
|
-
{
|
|
21
|
-
icon: item.icon || item.title,
|
|
22
|
-
sx: { bgcolor: theme.palette.grey[600], color: "#fff" },
|
|
23
|
-
size: 24,
|
|
24
|
-
component: "span"
|
|
25
|
-
}
|
|
26
|
-
)
|
|
17
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: item.icon || item.title, size: 24, component: "span" })
|
|
27
18
|
},
|
|
28
19
|
i
|
|
29
20
|
);
|
|
@@ -48,7 +39,7 @@ const Root = styled("div")`
|
|
|
48
39
|
justify-content: center;
|
|
49
40
|
gap: 20px;
|
|
50
41
|
a {
|
|
51
|
-
color: ${(props) => props.theme.palette.grey[
|
|
42
|
+
color: ${(props) => props.theme.palette.grey[400]};
|
|
52
43
|
text-decoration: none;
|
|
53
44
|
transition: color 0.2s ease-in-out;
|
|
54
45
|
&:hover {
|
package/lib/Header/index.js
CHANGED
|
@@ -7,7 +7,6 @@ import { styled, useTheme, deepmerge, ThemeProvider } from "@arcblock/ux/lib/The
|
|
|
7
7
|
import { ResponsiveHeader } from "@arcblock/ux/lib/Header";
|
|
8
8
|
import NavMenu, { Products } from "@arcblock/ux/lib/NavMenu";
|
|
9
9
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
10
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
11
10
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
12
11
|
import omit from "lodash/omit";
|
|
13
12
|
import isFinite from "lodash/isFinite";
|
|
@@ -18,7 +17,7 @@ import { publicPath, formatBlockletInfo, getLocalizedNavigation } from "../block
|
|
|
18
17
|
import HeaderAddons from "../common/header-addons.js";
|
|
19
18
|
import { useWalletHiddenTopbar } from "../common/wallet-hidden-topbar.js";
|
|
20
19
|
import withHideWhenEmbed from "../libs/with-hide-when-embed.js";
|
|
21
|
-
import
|
|
20
|
+
import useBlockletLogo from "../hooks/use-blocklet-logo.js";
|
|
22
21
|
const translations = {
|
|
23
22
|
en: {
|
|
24
23
|
products: "Products"
|
|
@@ -89,12 +88,14 @@ function Header({
|
|
|
89
88
|
return blocklet;
|
|
90
89
|
}
|
|
91
90
|
}, [meta]);
|
|
92
|
-
const isMobileDevice = useMobile();
|
|
93
91
|
const mergeTheme = useMemo(() => deepmerge(parentTheme, themeOverrides), [parentTheme, themeOverrides]);
|
|
92
|
+
const appLogo = useBlockletLogo({
|
|
93
|
+
meta,
|
|
94
|
+
theme: themeOverrides
|
|
95
|
+
});
|
|
94
96
|
if (!formattedBlocklet.appName) {
|
|
95
97
|
return null;
|
|
96
98
|
}
|
|
97
|
-
const { appLogo, appLogoRect } = formattedBlocklet;
|
|
98
99
|
const navigation = getLocalizedNavigation(formattedBlocklet?.navigation?.header, locale);
|
|
99
100
|
const parsedNavigation = parseNavigation(navigation);
|
|
100
101
|
const { navItems, activeId } = parsedNavigation;
|
|
@@ -123,7 +124,7 @@ function Header({
|
|
|
123
124
|
StyledUxHeader,
|
|
124
125
|
{
|
|
125
126
|
homeLink,
|
|
126
|
-
logo: /* @__PURE__ */ jsx("img", { src:
|
|
127
|
+
logo: /* @__PURE__ */ jsx("img", { src: appLogo, alt: "logo" }),
|
|
127
128
|
addons: headerAddons,
|
|
128
129
|
...omit(rest, ["bordered"]),
|
|
129
130
|
$bordered: rest?.bordered,
|
|
@@ -152,7 +153,7 @@ const StyledUxHeader = styled(ResponsiveHeader)`
|
|
|
152
153
|
.header-logo {
|
|
153
154
|
min-width: 44px;
|
|
154
155
|
}
|
|
155
|
-
${({ $bordered }) => $bordered ? `border-bottom: 1px solid ${
|
|
156
|
+
${({ $bordered, theme }) => $bordered ? `border-bottom: 1px solid ${theme.palette.divider};` : ""}
|
|
156
157
|
${(props) => props.theme.breakpoints.down("md")} {
|
|
157
158
|
.header-logo {
|
|
158
159
|
min-width: 32px;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useCreation, useMemoizedFn } from "ahooks";
|
|
4
|
-
import {
|
|
5
|
-
import Link from "@mui/material/Link";
|
|
4
|
+
import { useTheme, Link } from "@mui/material";
|
|
6
5
|
import { WELLKNOWN_SERVICE_PATH_PREFIX } from "@abtnode/constant";
|
|
7
6
|
import { joinURL, withQuery } from "ufo";
|
|
8
7
|
import isEmpty from "lodash/isEmpty";
|
|
@@ -40,13 +39,15 @@ const ACTIVITY_DESCRIPTIONS = {
|
|
|
40
39
|
] }),
|
|
41
40
|
assign: () => /* @__PURE__ */ jsx(Fragment, { children: "assigned you a task" })
|
|
42
41
|
};
|
|
43
|
-
function UserLink({ user, color
|
|
42
|
+
function UserLink({ user, color }) {
|
|
43
|
+
const { palette } = useTheme();
|
|
44
44
|
const profileLink = withQuery(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, "user"), { did: user.did });
|
|
45
|
+
const _color = color || palette.text.primary;
|
|
45
46
|
return /* @__PURE__ */ jsx(
|
|
46
47
|
Link,
|
|
47
48
|
{
|
|
48
49
|
href: profileLink,
|
|
49
|
-
color,
|
|
50
|
+
color: _color,
|
|
50
51
|
fontWeight: 600,
|
|
51
52
|
target: "_blank",
|
|
52
53
|
sx: { textDecoration: "none", "&:hover": { cursor: "pointer" } },
|
|
@@ -59,9 +60,10 @@ function UserLink({ user, color = colors.textBase }) {
|
|
|
59
60
|
}
|
|
60
61
|
UserLink.displayName = "UserLink";
|
|
61
62
|
export default function useActivityTitle({ activity, users, actors, extra = {}, mountPoint = "" }) {
|
|
63
|
+
const { palette } = useTheme();
|
|
62
64
|
const { type, target } = activity || {};
|
|
63
65
|
const { type: targetType } = target || {};
|
|
64
|
-
const { linkColor =
|
|
66
|
+
const { linkColor = palette.text.primary } = extra || {};
|
|
65
67
|
const usersMap = useCreation(() => {
|
|
66
68
|
if (!Array.isArray(users))
|
|
67
69
|
return /* @__PURE__ */ new Map();
|
|
@@ -4,7 +4,6 @@ import { useMemoizedFn, useReactive } from "ahooks";
|
|
|
4
4
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
5
5
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
6
6
|
import Toast from "@arcblock/ux/lib/Toast";
|
|
7
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
8
7
|
import ArrowDownwardIcon from "@arcblock/icons/lib/ArrowDown";
|
|
9
8
|
import { translations } from "../libs/locales.js";
|
|
10
9
|
import { client } from "../../libs/client.js";
|
|
@@ -74,11 +73,11 @@ export default function ConfigProfile({ user, onSave }) {
|
|
|
74
73
|
minWidth: 300,
|
|
75
74
|
"&:hover": {
|
|
76
75
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
77
|
-
borderColor:
|
|
76
|
+
borderColor: "divider"
|
|
78
77
|
}
|
|
79
78
|
},
|
|
80
79
|
fieldset: {
|
|
81
|
-
borderColor:
|
|
80
|
+
borderColor: "divider"
|
|
82
81
|
}
|
|
83
82
|
},
|
|
84
83
|
children: (window.blocklet.languages || languages).map((x) => /* @__PURE__ */ jsx(MenuItem, { value: x.code, children: x.name }, x.code))
|
|
@@ -22,6 +22,7 @@ interface EditableFieldProps {
|
|
|
22
22
|
hidePreview?: boolean;
|
|
23
23
|
renderValue?: (value: string) => React.ReactNode;
|
|
24
24
|
}
|
|
25
|
+
/** only for sx */
|
|
25
26
|
export declare const commonInputStyle: {
|
|
26
27
|
'.MuiOutlinedInput-root': {
|
|
27
28
|
'&:hover': {
|
|
@@ -36,6 +37,7 @@ export declare const commonInputStyle: {
|
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
};
|
|
40
|
+
/** only for sx */
|
|
39
41
|
export declare const inputFieldStyle: {
|
|
40
42
|
width: string;
|
|
41
43
|
'& .MuiFormHelperText-root': {
|
|
@@ -2,7 +2,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Box, TextField, Typography, Tooltip } from "@mui/material";
|
|
4
4
|
import { useCreation, useMemoizedFn } from "ahooks";
|
|
5
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
6
5
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
7
6
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
8
7
|
import VerifiedIcon from "@mui/icons-material/Verified";
|
|
@@ -12,12 +11,12 @@ export const commonInputStyle = {
|
|
|
12
11
|
".MuiOutlinedInput-root": {
|
|
13
12
|
"&:hover": {
|
|
14
13
|
fieldset: {
|
|
15
|
-
borderColor:
|
|
14
|
+
borderColor: "divider"
|
|
16
15
|
}
|
|
17
16
|
},
|
|
18
17
|
"&.Mui-focused": {
|
|
19
18
|
fieldset: {
|
|
20
|
-
borderColor:
|
|
19
|
+
borderColor: "divider"
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
}
|
|
@@ -31,7 +30,7 @@ export const inputFieldStyle = {
|
|
|
31
30
|
margin: 0
|
|
32
31
|
},
|
|
33
32
|
fieldset: {
|
|
34
|
-
borderColor:
|
|
33
|
+
borderColor: "divider"
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
36
|
function EditableField({
|
|
@@ -218,7 +217,7 @@ function EditableField({
|
|
|
218
217
|
) : null;
|
|
219
218
|
}
|
|
220
219
|
return /* @__PURE__ */ jsxs(Box, { sx: { width: "100%" }, style, children: [
|
|
221
|
-
label && /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, sx: { mb: 0.5, fontSize: "12px", color: "
|
|
220
|
+
label && /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, sx: { mb: 0.5, fontSize: "12px", color: "text.primary" }, children: label }),
|
|
222
221
|
content
|
|
223
222
|
] });
|
|
224
223
|
}
|
|
@@ -2,7 +2,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Pagination, Skeleton, Typography } from "@mui/material";
|
|
3
3
|
import { useCreation, useMemoizedFn, useReactive, useRequest } from "ahooks";
|
|
4
4
|
import axios from "axios";
|
|
5
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
6
5
|
import NFTDisplay from "@arcblock/ux/lib/NFTDisplay";
|
|
7
6
|
import Empty from "@arcblock/ux/lib/Empty";
|
|
8
7
|
import { WELLKNOWN_SERVICE_PATH_PREFIX } from "@abtnode/constant";
|
|
@@ -41,7 +40,7 @@ export default function Nft({ user }) {
|
|
|
41
40
|
};
|
|
42
41
|
const content = useCreation(() => {
|
|
43
42
|
if (loading) {
|
|
44
|
-
const skeletonItems = ["skeleton-1", "skeleton-2", "skeleton-3", "skeleton-4", "skeleton-5"].map((id) => /* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", width: "15%", height: 166, sx: { borderRadius:
|
|
43
|
+
const skeletonItems = ["skeleton-1", "skeleton-2", "skeleton-3", "skeleton-4", "skeleton-5"].map((id) => /* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", width: "15%", height: 166, sx: { borderRadius: 1, flexShrink: 0 } }, id));
|
|
45
44
|
return /* @__PURE__ */ jsxs(Box, { display: "flex", flexDirection: "column", gap: 2, children: [
|
|
46
45
|
/* @__PURE__ */ jsx(Skeleton, { width: "20%" }),
|
|
47
46
|
/* @__PURE__ */ jsx(Box, { display: "flex", flexDirection: "row", gap: 2, flexWrap: "nowrap", children: skeletonItems })
|
|
@@ -52,7 +51,7 @@ export default function Nft({ user }) {
|
|
|
52
51
|
Typography,
|
|
53
52
|
{
|
|
54
53
|
sx: {
|
|
55
|
-
color:
|
|
54
|
+
color: "grey.A700",
|
|
56
55
|
fontWeight: 600,
|
|
57
56
|
mb: 2.5
|
|
58
57
|
},
|
|
@@ -90,5 +89,5 @@ export default function Nft({ user }) {
|
|
|
90
89
|
) : null
|
|
91
90
|
] });
|
|
92
91
|
}, [loading, dataPage, paging.page, paging.size, handlePageChange]);
|
|
93
|
-
return /* @__PURE__ */ jsx(Box, { sx: { border:
|
|
92
|
+
return /* @__PURE__ */ jsx(Box, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1, p: 2, mb: 5 }, children: content });
|
|
94
93
|
}
|
|
@@ -5,7 +5,6 @@ import { Icon } from "@iconify/react";
|
|
|
5
5
|
import AddRoundedIcon from "@iconify-icons/material-symbols/add-rounded";
|
|
6
6
|
import Switch from "@arcblock/ux/lib/Switch";
|
|
7
7
|
import Button from "@arcblock/ux/lib/Button";
|
|
8
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
9
8
|
import Toast from "@arcblock/ux/lib/Toast";
|
|
10
9
|
import { getWalletDid } from "@arcblock/ux/lib/SessionUser/libs/utils";
|
|
11
10
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
@@ -232,15 +231,13 @@ export default function Notification({ user }) {
|
|
|
232
231
|
variant: "outlined",
|
|
233
232
|
size: "small",
|
|
234
233
|
sx: {
|
|
235
|
-
color:
|
|
236
|
-
borderColor:
|
|
237
|
-
backgroundColor: colors.buttonsButtonNeutral,
|
|
234
|
+
color: "text.primary",
|
|
235
|
+
borderColor: "divider",
|
|
238
236
|
"&:hover": {
|
|
239
|
-
borderColor:
|
|
240
|
-
backgroundColor: colors.buttonsButtonNeutralHover
|
|
237
|
+
borderColor: "divider"
|
|
241
238
|
},
|
|
242
239
|
py: 0.5,
|
|
243
|
-
borderRadius:
|
|
240
|
+
borderRadius: 1
|
|
244
241
|
},
|
|
245
242
|
startIcon: /* @__PURE__ */ jsx(Icon, { icon: AddRoundedIcon }),
|
|
246
243
|
onClick: () => {
|
|
@@ -2,7 +2,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
3
|
import Empty from "@arcblock/ux/lib/Empty";
|
|
4
4
|
import { useTheme } from "@arcblock/ux/lib/Theme";
|
|
5
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
6
5
|
import PassportItem from "@arcblock/ux/lib/Passport";
|
|
7
6
|
import { PASSPORT_STATUS } from "@arcblock/ux/lib/Util/constant";
|
|
8
7
|
import { useCreation, useMemoizedFn } from "ahooks";
|
|
@@ -42,9 +41,7 @@ export default function Passport({ user, ...rest }) {
|
|
|
42
41
|
);
|
|
43
42
|
}, [user?.passports]);
|
|
44
43
|
const currentRole = useCreation(() => passports?.find((item) => item.name === user.role), [passports, user?.role]);
|
|
45
|
-
const activeColor =
|
|
46
|
-
return theme?.palette?.primary?.main || colors.textBase;
|
|
47
|
-
}, [theme?.palette?.primary?.main]);
|
|
44
|
+
const activeColor = theme.palette.primary.main;
|
|
48
45
|
if (passports.length === 0) {
|
|
49
46
|
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Empty, { children: t("noPassport") }) });
|
|
50
47
|
}
|
|
@@ -79,11 +76,11 @@ export default function Passport({ user, ...rest }) {
|
|
|
79
76
|
".passport-item__display": {
|
|
80
77
|
width: 166,
|
|
81
78
|
height: 166,
|
|
82
|
-
borderRadius:
|
|
79
|
+
borderRadius: 1,
|
|
83
80
|
px: 2,
|
|
84
81
|
display: "flex",
|
|
85
82
|
justifyContent: "center",
|
|
86
|
-
backgroundColor:
|
|
83
|
+
backgroundColor: "grey.50",
|
|
87
84
|
boxShadow: currentRole && currentRole.role === x.role ? `0px 2px 4px 0px ${activeColor}, 0px 1px 2px -1px ${activeColor}, 0px 0px 0px 1px ${activeColor} !important` : "unset"
|
|
88
85
|
},
|
|
89
86
|
".passport-item__body": {
|
|
@@ -5,7 +5,6 @@ import { useCreation, useMemoizedFn } from "ahooks";
|
|
|
5
5
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
6
6
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
7
7
|
import { mergeSx } from "@arcblock/ux/lib/Util/style";
|
|
8
|
-
import colors from "@arcblock/ux/lib/Colors/themes/temp";
|
|
9
8
|
import { translations } from "../libs/locales.js";
|
|
10
9
|
import Notification from "./notification.js";
|
|
11
10
|
import Privacy from "./privacy.js";
|
|
@@ -108,8 +107,9 @@ export default function Settings({
|
|
|
108
107
|
id: tab.value,
|
|
109
108
|
sx: mergeSx(
|
|
110
109
|
{
|
|
111
|
-
border:
|
|
112
|
-
|
|
110
|
+
border: "1px solid",
|
|
111
|
+
borderColor: "divider",
|
|
112
|
+
borderRadius: 1,
|
|
113
113
|
p: 2,
|
|
114
114
|
"&:last-child": {
|
|
115
115
|
mb: 5
|
|
@@ -122,7 +122,7 @@ export default function Settings({
|
|
|
122
122
|
Typography,
|
|
123
123
|
{
|
|
124
124
|
sx: {
|
|
125
|
-
color:
|
|
125
|
+
color: "text.primary",
|
|
126
126
|
fontWeight: 600
|
|
127
127
|
},
|
|
128
128
|
children: tab.label
|
|
@@ -19,7 +19,6 @@ import dayjs from "dayjs";
|
|
|
19
19
|
import CloseIcon from "@mui/icons-material/Close";
|
|
20
20
|
import { translate } from "@arcblock/ux/lib/Locale/util";
|
|
21
21
|
import { useMemoizedFn } from "ahooks";
|
|
22
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
23
22
|
import ArrowDownwardIcon from "@arcblock/icons/lib/ArrowDown";
|
|
24
23
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
25
24
|
import { DurationEnum } from "../../../@types/index.js";
|
|
@@ -31,11 +30,11 @@ const selectStyle = {
|
|
|
31
30
|
borderRadius: "8px",
|
|
32
31
|
"&:hover": {
|
|
33
32
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
34
|
-
borderColor:
|
|
33
|
+
borderColor: "divider"
|
|
35
34
|
}
|
|
36
35
|
},
|
|
37
36
|
"fieldset.MuiOutlinedInput-notchedOutline": {
|
|
38
|
-
borderColor:
|
|
37
|
+
borderColor: "divider",
|
|
39
38
|
borderRadius: "8px"
|
|
40
39
|
},
|
|
41
40
|
".MuiSelect-select": {
|
|
@@ -95,7 +94,7 @@ export default function StatusDialog({ open, onClose, data, selected, onSelect,
|
|
|
95
94
|
}
|
|
96
95
|
},
|
|
97
96
|
children: [
|
|
98
|
-
/* @__PURE__ */ jsxs(DialogTitle, { sx: { borderBottom:
|
|
97
|
+
/* @__PURE__ */ jsxs(DialogTitle, { sx: { borderBottom: "1px solid", borderColor: "divider" }, children: [
|
|
99
98
|
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { fontSize: "16px !important", mb: 0 }, children: t("profile.setStatus") }),
|
|
100
99
|
/* @__PURE__ */ jsx(
|
|
101
100
|
IconButton,
|
|
@@ -203,7 +202,7 @@ export default function StatusDialog({ open, onClose, data, selected, onSelect,
|
|
|
203
202
|
}
|
|
204
203
|
) })
|
|
205
204
|
] }),
|
|
206
|
-
/* @__PURE__ */ jsx(DialogActions, { sx: { p: "16px 24px", borderTop:
|
|
205
|
+
/* @__PURE__ */ jsx(DialogActions, { sx: { p: "16px 24px", borderTop: "1px solid", borderColor: "divider" }, children: selected?.value && !changed ? /* @__PURE__ */ jsx(
|
|
207
206
|
Button,
|
|
208
207
|
{
|
|
209
208
|
sx: { ...defaultButtonStyle, minWidth: "54px" },
|
|
@@ -4,6 +4,4 @@ interface StatusDurationMenuProps extends BaseStatusProps {
|
|
|
4
4
|
}
|
|
5
5
|
declare function DurationMenu({ data, selected, onSelect }: StatusDurationMenuProps): import("react").JSX.Element;
|
|
6
6
|
export default DurationMenu;
|
|
7
|
-
export declare const MenuDiv: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & {
|
|
8
|
-
theme?: import("@emotion/react").Theme;
|
|
9
|
-
}, {}, {}>;
|
|
7
|
+
export declare const MenuDiv: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Menu, Typography } from "@mui/material";
|
|
3
|
-
import styled from "@emotion/styled";
|
|
4
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
2
|
+
import { Menu, styled, Typography } from "@mui/material";
|
|
5
3
|
import { useState } from "react";
|
|
6
4
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
7
5
|
import { useMemoizedFn } from "ahooks";
|
|
@@ -70,6 +68,6 @@ export const MenuDiv = styled(Menu)`
|
|
|
70
68
|
min-width: 160px;
|
|
71
69
|
}
|
|
72
70
|
.selected {
|
|
73
|
-
background-color: ${
|
|
71
|
+
background-color: ${({ theme }) => theme.palette.grey[50]};
|
|
74
72
|
}
|
|
75
73
|
`;
|
|
@@ -8,9 +8,7 @@ interface StatusMenuItemProps {
|
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export default function StatusMenuItem({ icon, selected, onClick, children }: StatusMenuItemProps): JSX.Element;
|
|
11
|
-
export declare const StyledMenu: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & {
|
|
12
|
-
theme?: import("@emotion/react").Theme;
|
|
13
|
-
}, {}, {}>;
|
|
11
|
+
export declare const StyledMenu: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
14
12
|
export interface StatusItem {
|
|
15
13
|
id: string;
|
|
16
14
|
name: string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ListItemIcon, MenuItem, Menu } from "@mui/material";
|
|
2
|
+
import { ListItemIcon, MenuItem, Menu, styled } from "@mui/material";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import styled from "@emotion/styled";
|
|
5
|
-
import { temp as colors } from "@arcblock/ux/lib/Colors";
|
|
6
4
|
export default function StatusMenuItem({ icon, selected, onClick, children }) {
|
|
7
5
|
return /* @__PURE__ */ jsxs(MenuItem, { onClick, className: selected ? "selected" : "", children: [
|
|
8
6
|
icon && /* @__PURE__ */ jsx(ListItemIcon, { style: { minWidth: "24px" }, children: React.createElement(icon, {
|
|
@@ -19,6 +17,6 @@ export const StyledMenu = styled(Menu)`
|
|
|
19
17
|
min-width: 160px;
|
|
20
18
|
}
|
|
21
19
|
.selected {
|
|
22
|
-
background-color: ${
|
|
20
|
+
background-color: ${({ theme }) => theme.palette.grey[50]};
|
|
23
21
|
}
|
|
24
22
|
`;
|