@blocklet/ui-react 2.9.51 → 2.9.52
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/es/UserCenter/components/storage/connected.d.ts +1 -1
- package/es/UserCenter/components/storage/connected.js +5 -2
- package/es/UserCenter/components/storage/index.js +4 -2
- package/es/UserCenter/components/storage/item.js +6 -11
- package/es/UserCenter/libs/locales.d.ts +52 -0
- package/es/UserCenter/libs/locales.js +54 -2
- package/lib/UserCenter/components/storage/connected.d.ts +1 -1
- package/lib/UserCenter/components/storage/connected.js +1 -1
- package/lib/UserCenter/components/storage/index.js +22 -17
- package/lib/UserCenter/components/storage/item.js +0 -12
- package/lib/UserCenter/libs/locales.d.ts +52 -0
- package/lib/UserCenter/libs/locales.js +54 -2
- package/package.json +4 -4
- package/src/UserCenter/components/storage/connected.tsx +9 -3
- package/src/UserCenter/components/storage/index.tsx +17 -13
- package/src/UserCenter/components/storage/item.tsx +6 -12
- package/src/UserCenter/libs/locales.ts +52 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SettingStorageEndpoint, SpaceGateway } from '../../../contexts/config-user-space';
|
|
3
|
-
declare function Connected({ spaceGateway, settingStorageEndpoint }: {
|
|
3
|
+
declare function Connected({ spaceGateway, settingStorageEndpoint, }: {
|
|
4
4
|
spaceGateway: SpaceGateway | undefined;
|
|
5
5
|
settingStorageEndpoint: SettingStorageEndpoint;
|
|
6
6
|
}): import("react").JSX.Element;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Typography } from "@mui/material";
|
|
3
2
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
3
|
+
import { Box, Typography } from "@mui/material";
|
|
4
4
|
import SpaceItem from "./item.js";
|
|
5
|
-
function Connected({
|
|
5
|
+
function Connected({
|
|
6
|
+
spaceGateway,
|
|
7
|
+
settingStorageEndpoint
|
|
8
|
+
}) {
|
|
6
9
|
const { t } = useLocaleContext();
|
|
7
10
|
return /* @__PURE__ */ jsxs(Box, { display: "flex", flexDirection: "column", children: [
|
|
8
11
|
/* @__PURE__ */ jsx(Box, { display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: "12px", children: /* @__PURE__ */ jsx(Typography, { fontSize: "1.2rem", fontWeight: "bold", children: t("storage.spaces.connected.title") }) }),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Center from "@arcblock/ux/lib/Center";
|
|
3
|
+
import { LocaleProvider } from "@arcblock/ux/lib/Locale/context";
|
|
3
4
|
import styled from "@emotion/styled";
|
|
4
5
|
import { Box, CircularProgress } from "@mui/material";
|
|
5
6
|
import { useConfigUserSpaceContext } from "../../../contexts/config-user-space.js";
|
|
@@ -7,16 +8,17 @@ import useMobile from "../../../hooks/use-mobile.js";
|
|
|
7
8
|
import ConnectTo from "./connect-to.js";
|
|
8
9
|
import Connected from "./connected.js";
|
|
9
10
|
import Disconnect from "./disconnect.js";
|
|
11
|
+
import { translations } from "../../libs/locales.js";
|
|
10
12
|
function DidSpace() {
|
|
11
13
|
const isMobile = useMobile({});
|
|
12
14
|
const { spaceGateway, updateSpaceGateway, settingStorageEndpoint, hasStorageEndpoint, loading, storageEndpoint } = useConfigUserSpaceContext();
|
|
13
15
|
if (loading) {
|
|
14
16
|
return /* @__PURE__ */ jsx(Center, { relative: "parent", children: /* @__PURE__ */ jsx(CircularProgress, {}) });
|
|
15
17
|
}
|
|
16
|
-
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
18
|
+
return /* @__PURE__ */ jsx(LocaleProvider, { translations, children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
17
19
|
/* @__PURE__ */ jsx(Box, { maxWidth: isMobile ? "360px" : "720px", children: hasStorageEndpoint ? /* @__PURE__ */ jsx(Connected, { spaceGateway, settingStorageEndpoint }) : /* @__PURE__ */ jsx(Disconnect, {}) }),
|
|
18
20
|
/* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", justifyContent: "center", paddingTop: "24px", children: /* @__PURE__ */ jsx(ConnectTo, { onConnect: updateSpaceGateway, storageEndpoint }) })
|
|
19
|
-
] });
|
|
21
|
+
] }) });
|
|
20
22
|
}
|
|
21
23
|
const Container = styled(Box)`
|
|
22
24
|
height: 100%;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Chip, Typography } from "@mui/material";
|
|
3
3
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
4
|
-
import toast from "@arcblock/ux/lib/Toast";
|
|
5
4
|
import CheckIcon from "@mui/icons-material/Check";
|
|
6
5
|
import styled from "@emotion/styled";
|
|
7
6
|
import SpacesConnectedSvg from "./icons/space-connected.svg?react";
|
|
@@ -9,18 +8,14 @@ import DidAddress from "@arcblock/ux/lib/DID";
|
|
|
9
8
|
import PreviewSpaceNft from "./preview-nft.js";
|
|
10
9
|
import useMobile from "../../../hooks/use-mobile.js";
|
|
11
10
|
import { getSpaceNftDisplayUrlFromEndpoint } from "../../../libs/spaces.js";
|
|
12
|
-
function SpaceItem({
|
|
11
|
+
function SpaceItem({
|
|
12
|
+
spaceGateway,
|
|
13
|
+
connected,
|
|
14
|
+
onDisconnect,
|
|
15
|
+
...rest
|
|
16
|
+
}) {
|
|
13
17
|
const isMobile = useMobile({});
|
|
14
18
|
const { t } = useLocaleContext();
|
|
15
|
-
const handleOnDisconnect = async () => {
|
|
16
|
-
try {
|
|
17
|
-
await onDisconnect();
|
|
18
|
-
toast.success(t("storage.spaces.gateway.delete.succeeded", { name: spaceGateway.name }));
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error(error);
|
|
21
|
-
toast.error(error.message);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
19
|
return /* @__PURE__ */ jsxs(
|
|
25
20
|
BoxContainer,
|
|
26
21
|
{
|
|
@@ -41,6 +41,32 @@ export declare const translations: {
|
|
|
41
41
|
myInfo: string;
|
|
42
42
|
loginNow: string;
|
|
43
43
|
viewAfterLogin: string;
|
|
44
|
+
storage: {
|
|
45
|
+
spaces: {
|
|
46
|
+
tips: string;
|
|
47
|
+
label: string;
|
|
48
|
+
connectedWithName: string;
|
|
49
|
+
gateway: {
|
|
50
|
+
delete: {
|
|
51
|
+
failed: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
provideNFT: {
|
|
55
|
+
title: string;
|
|
56
|
+
scan: string;
|
|
57
|
+
success: string;
|
|
58
|
+
};
|
|
59
|
+
connect: {
|
|
60
|
+
useWallet: string;
|
|
61
|
+
useWalletReconnect: string;
|
|
62
|
+
providerForStorage: string;
|
|
63
|
+
};
|
|
64
|
+
connected: {
|
|
65
|
+
title: string;
|
|
66
|
+
tag: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
44
70
|
};
|
|
45
71
|
en: {
|
|
46
72
|
settings: string;
|
|
@@ -84,5 +110,31 @@ export declare const translations: {
|
|
|
84
110
|
myInfo: string;
|
|
85
111
|
loginNow: string;
|
|
86
112
|
viewAfterLogin: string;
|
|
113
|
+
storage: {
|
|
114
|
+
spaces: {
|
|
115
|
+
tips: string;
|
|
116
|
+
label: string;
|
|
117
|
+
connectedWithName: string;
|
|
118
|
+
gateway: {
|
|
119
|
+
delete: {
|
|
120
|
+
failed: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
provideNFT: {
|
|
124
|
+
title: string;
|
|
125
|
+
scan: string;
|
|
126
|
+
success: string;
|
|
127
|
+
};
|
|
128
|
+
connect: {
|
|
129
|
+
useWallet: string;
|
|
130
|
+
useWalletReconnect: string;
|
|
131
|
+
providerForStorage: string;
|
|
132
|
+
};
|
|
133
|
+
connected: {
|
|
134
|
+
title: string;
|
|
135
|
+
tag: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
87
139
|
};
|
|
88
140
|
};
|
|
@@ -40,7 +40,33 @@ export const translations = {
|
|
|
40
40
|
userInfo: "\u4E2A\u4EBA\u4FE1\u606F",
|
|
41
41
|
myInfo: "\u6211\u7684\u4FE1\u606F",
|
|
42
42
|
loginNow: "\u7ACB\u5373\u767B\u5F55",
|
|
43
|
-
viewAfterLogin: "\u767B\u5F55\u540E\u624D\u53EF\u4EE5\u67E5\u770B"
|
|
43
|
+
viewAfterLogin: "\u767B\u5F55\u540E\u624D\u53EF\u4EE5\u67E5\u770B",
|
|
44
|
+
storage: {
|
|
45
|
+
spaces: {
|
|
46
|
+
tips: "\u63D0\u793A",
|
|
47
|
+
label: "\u8BF7\u8F93\u5165 DID Spaces \u670D\u52A1\u5730\u5740",
|
|
48
|
+
connectedWithName: "\u4F60\u5DF2\u6210\u529F\u8FDE\u63A5\u81F3 {name}",
|
|
49
|
+
gateway: {
|
|
50
|
+
delete: {
|
|
51
|
+
failed: "\u5220\u9664 DID Spaces \u5931\u8D25"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
provideNFT: {
|
|
55
|
+
title: "\u8BF7\u4E3A {appName} \u51FA\u793A DID Spaces NFT",
|
|
56
|
+
scan: "\u4F7F\u7528\u4F60\u7684 DID Wallet \u626B\u63CF\u4E0B\u9762\u7684\u4E8C\u7EF4\u7801\u4E3A\u5E94\u7528 {appName} \u51FA\u793A DID Spaces NFT",
|
|
57
|
+
success: "\u8FDE\u63A5\u6210\u529F"
|
|
58
|
+
},
|
|
59
|
+
connect: {
|
|
60
|
+
useWallet: "\u4F7F\u7528 DID Wallet \u8FDE\u63A5",
|
|
61
|
+
useWalletReconnect: "\u4F7F\u7528 DID Wallet \u91CD\u65B0\u8FDE\u63A5",
|
|
62
|
+
providerForStorage: "\u8BF7\u8FDE\u63A5\u60A8\u7684 DID Spaces"
|
|
63
|
+
},
|
|
64
|
+
connected: {
|
|
65
|
+
title: "\u5DF2\u8FDE\u63A5\u7684 DID Spaces",
|
|
66
|
+
tag: "\u5DF2\u8FDE\u63A5"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
44
70
|
},
|
|
45
71
|
en: {
|
|
46
72
|
settings: "Settings",
|
|
@@ -83,6 +109,32 @@ export const translations = {
|
|
|
83
109
|
userInfo: "User Info",
|
|
84
110
|
myInfo: "My Info",
|
|
85
111
|
loginNow: "Login",
|
|
86
|
-
viewAfterLogin: "View after login"
|
|
112
|
+
viewAfterLogin: "View after login",
|
|
113
|
+
storage: {
|
|
114
|
+
spaces: {
|
|
115
|
+
tips: "Tips",
|
|
116
|
+
label: "Enter DID Spaces Gateway",
|
|
117
|
+
connectedWithName: "You have successfully connected to {name}",
|
|
118
|
+
gateway: {
|
|
119
|
+
delete: {
|
|
120
|
+
failed: "Delete gateway failed"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
provideNFT: {
|
|
124
|
+
title: "Please show the DID Spaces NFT for {appName}",
|
|
125
|
+
scan: "Use your DID Wallet to scan the QR code below to allow the app {appName} show DID space NFT",
|
|
126
|
+
success: "Connected successfully"
|
|
127
|
+
},
|
|
128
|
+
connect: {
|
|
129
|
+
useWallet: "Connect with DID Wallet",
|
|
130
|
+
useWalletReconnect: "Reconnect with DID Wallet",
|
|
131
|
+
providerForStorage: "Please connect your DID Spaces"
|
|
132
|
+
},
|
|
133
|
+
connected: {
|
|
134
|
+
title: "Connected DID Spaces",
|
|
135
|
+
tag: "Connected"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
87
139
|
}
|
|
88
140
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SettingStorageEndpoint, SpaceGateway } from '../../../contexts/config-user-space';
|
|
3
|
-
declare function Connected({ spaceGateway, settingStorageEndpoint }: {
|
|
3
|
+
declare function Connected({ spaceGateway, settingStorageEndpoint, }: {
|
|
4
4
|
spaceGateway: SpaceGateway | undefined;
|
|
5
5
|
settingStorageEndpoint: SettingStorageEndpoint;
|
|
6
6
|
}): import("react").JSX.Element;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var _material = require("@mui/material");
|
|
9
8
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
10
|
var _item = _interopRequireDefault(require("./item"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function Connected({
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _Center = _interopRequireDefault(require("@arcblock/ux/lib/Center"));
|
|
9
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
9
10
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
11
|
var _material = require("@mui/material");
|
|
11
12
|
var _configUserSpace = require("../../../contexts/config-user-space");
|
|
@@ -13,6 +14,7 @@ var _useMobile = _interopRequireDefault(require("../../../hooks/use-mobile"));
|
|
|
13
14
|
var _connectTo = _interopRequireDefault(require("./connect-to"));
|
|
14
15
|
var _connected = _interopRequireDefault(require("./connected"));
|
|
15
16
|
var _disconnect = _interopRequireDefault(require("./disconnect"));
|
|
17
|
+
var _locales = require("../../libs/locales");
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
function DidSpace() {
|
|
18
20
|
const isMobile = (0, _useMobile.default)({});
|
|
@@ -30,23 +32,26 @@ function DidSpace() {
|
|
|
30
32
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {})
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
return /* @__PURE__ */(0, _jsxRuntime.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_context.LocaleProvider, {
|
|
36
|
+
translations: _locales.translations,
|
|
37
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(Container, {
|
|
38
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
39
|
+
maxWidth: isMobile ? "360px" : "720px",
|
|
40
|
+
children: hasStorageEndpoint ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_connected.default, {
|
|
41
|
+
spaceGateway,
|
|
42
|
+
settingStorageEndpoint
|
|
43
|
+
}) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_disconnect.default, {})
|
|
44
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
45
|
+
display: "flex",
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
justifyContent: "center",
|
|
48
|
+
paddingTop: "24px",
|
|
49
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_connectTo.default, {
|
|
50
|
+
onConnect: updateSpaceGateway,
|
|
51
|
+
storageEndpoint
|
|
52
|
+
})
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
50
55
|
});
|
|
51
56
|
}
|
|
52
57
|
const Container = (0, _styled.default)(_material.Box)`
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
9
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
10
|
-
var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
11
10
|
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
12
11
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
12
|
var _spaceConnected = _interopRequireDefault(require("./icons/space-connected.svg?react"));
|
|
@@ -26,17 +25,6 @@ function SpaceItem({
|
|
|
26
25
|
const {
|
|
27
26
|
t
|
|
28
27
|
} = (0, _context.useLocaleContext)();
|
|
29
|
-
const handleOnDisconnect = async () => {
|
|
30
|
-
try {
|
|
31
|
-
await onDisconnect();
|
|
32
|
-
_Toast.default.success(t("storage.spaces.gateway.delete.succeeded", {
|
|
33
|
-
name: spaceGateway.name
|
|
34
|
-
}));
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error(error);
|
|
37
|
-
_Toast.default.error(error.message);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
28
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(BoxContainer, {
|
|
41
29
|
style: {
|
|
42
30
|
position: "relative"
|
|
@@ -41,6 +41,32 @@ export declare const translations: {
|
|
|
41
41
|
myInfo: string;
|
|
42
42
|
loginNow: string;
|
|
43
43
|
viewAfterLogin: string;
|
|
44
|
+
storage: {
|
|
45
|
+
spaces: {
|
|
46
|
+
tips: string;
|
|
47
|
+
label: string;
|
|
48
|
+
connectedWithName: string;
|
|
49
|
+
gateway: {
|
|
50
|
+
delete: {
|
|
51
|
+
failed: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
provideNFT: {
|
|
55
|
+
title: string;
|
|
56
|
+
scan: string;
|
|
57
|
+
success: string;
|
|
58
|
+
};
|
|
59
|
+
connect: {
|
|
60
|
+
useWallet: string;
|
|
61
|
+
useWalletReconnect: string;
|
|
62
|
+
providerForStorage: string;
|
|
63
|
+
};
|
|
64
|
+
connected: {
|
|
65
|
+
title: string;
|
|
66
|
+
tag: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
44
70
|
};
|
|
45
71
|
en: {
|
|
46
72
|
settings: string;
|
|
@@ -84,5 +110,31 @@ export declare const translations: {
|
|
|
84
110
|
myInfo: string;
|
|
85
111
|
loginNow: string;
|
|
86
112
|
viewAfterLogin: string;
|
|
113
|
+
storage: {
|
|
114
|
+
spaces: {
|
|
115
|
+
tips: string;
|
|
116
|
+
label: string;
|
|
117
|
+
connectedWithName: string;
|
|
118
|
+
gateway: {
|
|
119
|
+
delete: {
|
|
120
|
+
failed: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
provideNFT: {
|
|
124
|
+
title: string;
|
|
125
|
+
scan: string;
|
|
126
|
+
success: string;
|
|
127
|
+
};
|
|
128
|
+
connect: {
|
|
129
|
+
useWallet: string;
|
|
130
|
+
useWalletReconnect: string;
|
|
131
|
+
providerForStorage: string;
|
|
132
|
+
};
|
|
133
|
+
connected: {
|
|
134
|
+
title: string;
|
|
135
|
+
tag: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
87
139
|
};
|
|
88
140
|
};
|
|
@@ -46,7 +46,33 @@ const translations = exports.translations = {
|
|
|
46
46
|
userInfo: "\u4E2A\u4EBA\u4FE1\u606F",
|
|
47
47
|
myInfo: "\u6211\u7684\u4FE1\u606F",
|
|
48
48
|
loginNow: "\u7ACB\u5373\u767B\u5F55",
|
|
49
|
-
viewAfterLogin: "\u767B\u5F55\u540E\u624D\u53EF\u4EE5\u67E5\u770B"
|
|
49
|
+
viewAfterLogin: "\u767B\u5F55\u540E\u624D\u53EF\u4EE5\u67E5\u770B",
|
|
50
|
+
storage: {
|
|
51
|
+
spaces: {
|
|
52
|
+
tips: "\u63D0\u793A",
|
|
53
|
+
label: "\u8BF7\u8F93\u5165 DID Spaces \u670D\u52A1\u5730\u5740",
|
|
54
|
+
connectedWithName: "\u4F60\u5DF2\u6210\u529F\u8FDE\u63A5\u81F3 {name}",
|
|
55
|
+
gateway: {
|
|
56
|
+
delete: {
|
|
57
|
+
failed: "\u5220\u9664 DID Spaces \u5931\u8D25"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
provideNFT: {
|
|
61
|
+
title: "\u8BF7\u4E3A {appName} \u51FA\u793A DID Spaces NFT",
|
|
62
|
+
scan: "\u4F7F\u7528\u4F60\u7684 DID Wallet \u626B\u63CF\u4E0B\u9762\u7684\u4E8C\u7EF4\u7801\u4E3A\u5E94\u7528 {appName} \u51FA\u793A DID Spaces NFT",
|
|
63
|
+
success: "\u8FDE\u63A5\u6210\u529F"
|
|
64
|
+
},
|
|
65
|
+
connect: {
|
|
66
|
+
useWallet: "\u4F7F\u7528 DID Wallet \u8FDE\u63A5",
|
|
67
|
+
useWalletReconnect: "\u4F7F\u7528 DID Wallet \u91CD\u65B0\u8FDE\u63A5",
|
|
68
|
+
providerForStorage: "\u8BF7\u8FDE\u63A5\u60A8\u7684 DID Spaces"
|
|
69
|
+
},
|
|
70
|
+
connected: {
|
|
71
|
+
title: "\u5DF2\u8FDE\u63A5\u7684 DID Spaces",
|
|
72
|
+
tag: "\u5DF2\u8FDE\u63A5"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
50
76
|
},
|
|
51
77
|
en: {
|
|
52
78
|
settings: "Settings",
|
|
@@ -89,6 +115,32 @@ const translations = exports.translations = {
|
|
|
89
115
|
userInfo: "User Info",
|
|
90
116
|
myInfo: "My Info",
|
|
91
117
|
loginNow: "Login",
|
|
92
|
-
viewAfterLogin: "View after login"
|
|
118
|
+
viewAfterLogin: "View after login",
|
|
119
|
+
storage: {
|
|
120
|
+
spaces: {
|
|
121
|
+
tips: "Tips",
|
|
122
|
+
label: "Enter DID Spaces Gateway",
|
|
123
|
+
connectedWithName: "You have successfully connected to {name}",
|
|
124
|
+
gateway: {
|
|
125
|
+
delete: {
|
|
126
|
+
failed: "Delete gateway failed"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
provideNFT: {
|
|
130
|
+
title: "Please show the DID Spaces NFT for {appName}",
|
|
131
|
+
scan: "Use your DID Wallet to scan the QR code below to allow the app {appName} show DID space NFT",
|
|
132
|
+
success: "Connected successfully"
|
|
133
|
+
},
|
|
134
|
+
connect: {
|
|
135
|
+
useWallet: "Connect with DID Wallet",
|
|
136
|
+
useWalletReconnect: "Reconnect with DID Wallet",
|
|
137
|
+
providerForStorage: "Please connect your DID Spaces"
|
|
138
|
+
},
|
|
139
|
+
connected: {
|
|
140
|
+
title: "Connected DID Spaces",
|
|
141
|
+
tag: "Connected"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
93
145
|
}
|
|
94
146
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.52",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@abtnode/constant": "^1.16.24",
|
|
66
|
-
"@arcblock/did-connect": "^2.9.
|
|
67
|
-
"@arcblock/ux": "^2.9.
|
|
66
|
+
"@arcblock/did-connect": "^2.9.52",
|
|
67
|
+
"@arcblock/ux": "^2.9.52",
|
|
68
68
|
"@blocklet/js-sdk": "^1.16.24",
|
|
69
69
|
"@emotion/react": "^11.10.4",
|
|
70
70
|
"@emotion/styled": "^11.10.4",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"jest": "^28.1.3",
|
|
102
102
|
"unbuild": "^2.0.0"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "362391bd55f3b943e59f16dfaaded615c64ecb93"
|
|
105
105
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { Box, Typography } from '@mui/material';
|
|
2
1
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
3
|
-
import
|
|
2
|
+
import { Box, Typography } from '@mui/material';
|
|
4
3
|
import { SettingStorageEndpoint, SpaceGateway } from '../../../contexts/config-user-space';
|
|
4
|
+
import SpaceItem from './item';
|
|
5
5
|
|
|
6
|
-
function Connected({
|
|
6
|
+
function Connected({
|
|
7
|
+
spaceGateway,
|
|
8
|
+
settingStorageEndpoint,
|
|
9
|
+
}: {
|
|
10
|
+
spaceGateway: SpaceGateway | undefined;
|
|
11
|
+
settingStorageEndpoint: SettingStorageEndpoint;
|
|
12
|
+
}) {
|
|
7
13
|
const { t } = useLocaleContext();
|
|
8
14
|
|
|
9
15
|
return (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Center from '@arcblock/ux/lib/Center';
|
|
2
|
+
import { LocaleProvider } from '@arcblock/ux/lib/Locale/context';
|
|
2
3
|
import styled from '@emotion/styled';
|
|
3
4
|
import { Box, CircularProgress } from '@mui/material';
|
|
4
5
|
import { useConfigUserSpaceContext } from '../../../contexts/config-user-space';
|
|
@@ -6,6 +7,7 @@ import useMobile from '../../../hooks/use-mobile';
|
|
|
6
7
|
import ConnectTo from './connect-to';
|
|
7
8
|
import Connected from './connected';
|
|
8
9
|
import Disconnect from './disconnect';
|
|
10
|
+
import { translations } from '../../libs/locales';
|
|
9
11
|
|
|
10
12
|
function DidSpace() {
|
|
11
13
|
const isMobile = useMobile({});
|
|
@@ -21,21 +23,23 @@ function DidSpace() {
|
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
+
<LocaleProvider translations={translations}>
|
|
27
|
+
<Container>
|
|
28
|
+
{/* 标题区 */}
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<Box maxWidth={isMobile ? '360px' : '720px'}>
|
|
31
|
+
{hasStorageEndpoint ? (
|
|
32
|
+
<Connected spaceGateway={spaceGateway} settingStorageEndpoint={settingStorageEndpoint} />
|
|
33
|
+
) : (
|
|
34
|
+
<Disconnect />
|
|
35
|
+
)}
|
|
36
|
+
</Box>
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
<Box display="flex" alignItems="center" justifyContent="center" paddingTop="24px">
|
|
39
|
+
<ConnectTo onConnect={updateSpaceGateway} storageEndpoint={storageEndpoint} />
|
|
40
|
+
</Box>
|
|
41
|
+
</Container>
|
|
42
|
+
</LocaleProvider>
|
|
39
43
|
);
|
|
40
44
|
}
|
|
41
45
|
|
|
@@ -12,21 +12,15 @@ import { SpaceGateway } from '../../../contexts/config-user-space';
|
|
|
12
12
|
import useMobile from '../../../hooks/use-mobile';
|
|
13
13
|
import { getSpaceNftDisplayUrlFromEndpoint } from '../../../libs/spaces';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
function SpaceItem({
|
|
16
|
+
spaceGateway,
|
|
17
|
+
connected,
|
|
18
|
+
onDisconnect,
|
|
19
|
+
...rest
|
|
20
|
+
}: { spaceGateway: SpaceGateway; connected: boolean; onDisconnect: Function } & BoxProps) {
|
|
17
21
|
const isMobile = useMobile({});
|
|
18
22
|
const { t } = useLocaleContext();
|
|
19
23
|
|
|
20
|
-
const handleOnDisconnect = async () => {
|
|
21
|
-
try {
|
|
22
|
-
await onDisconnect();
|
|
23
|
-
toast.success(t('storage.spaces.gateway.delete.succeeded', { name: spaceGateway.name }));
|
|
24
|
-
} catch (error: any) {
|
|
25
|
-
console.error(error);
|
|
26
|
-
toast.error(error.message);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
24
|
return (
|
|
31
25
|
<BoxContainer
|
|
32
26
|
style={{
|
|
@@ -41,6 +41,32 @@ export const translations = {
|
|
|
41
41
|
myInfo: '我的信息',
|
|
42
42
|
loginNow: '立即登录',
|
|
43
43
|
viewAfterLogin: '登录后才可以查看',
|
|
44
|
+
storage: {
|
|
45
|
+
spaces: {
|
|
46
|
+
tips: '提示',
|
|
47
|
+
label: '请输入 DID Spaces 服务地址',
|
|
48
|
+
connectedWithName: '你已成功连接至 {name}',
|
|
49
|
+
gateway: {
|
|
50
|
+
delete: {
|
|
51
|
+
failed: '删除 DID Spaces 失败',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
provideNFT: {
|
|
55
|
+
title: '请为 {appName} 出示 DID Spaces NFT',
|
|
56
|
+
scan: '使用你的 DID Wallet 扫描下面的二维码为应用 {appName} 出示 DID Spaces NFT',
|
|
57
|
+
success: '连接成功',
|
|
58
|
+
},
|
|
59
|
+
connect: {
|
|
60
|
+
useWallet: '使用 DID Wallet 连接',
|
|
61
|
+
useWalletReconnect: '使用 DID Wallet 重新连接',
|
|
62
|
+
providerForStorage: '请连接您的 DID Spaces',
|
|
63
|
+
},
|
|
64
|
+
connected: {
|
|
65
|
+
title: '已连接的 DID Spaces',
|
|
66
|
+
tag: '已连接',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
44
70
|
},
|
|
45
71
|
en: {
|
|
46
72
|
settings: 'Settings',
|
|
@@ -84,5 +110,31 @@ export const translations = {
|
|
|
84
110
|
myInfo: 'My Info',
|
|
85
111
|
loginNow: 'Login',
|
|
86
112
|
viewAfterLogin: 'View after login',
|
|
113
|
+
storage: {
|
|
114
|
+
spaces: {
|
|
115
|
+
tips: 'Tips',
|
|
116
|
+
label: 'Enter DID Spaces Gateway',
|
|
117
|
+
connectedWithName: 'You have successfully connected to {name}',
|
|
118
|
+
gateway: {
|
|
119
|
+
delete: {
|
|
120
|
+
failed: 'Delete gateway failed',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
provideNFT: {
|
|
124
|
+
title: 'Please show the DID Spaces NFT for {appName}',
|
|
125
|
+
scan: 'Use your DID Wallet to scan the QR code below to allow the app {appName} show DID space NFT',
|
|
126
|
+
success: 'Connected successfully',
|
|
127
|
+
},
|
|
128
|
+
connect: {
|
|
129
|
+
useWallet: 'Connect with DID Wallet',
|
|
130
|
+
useWalletReconnect: 'Reconnect with DID Wallet',
|
|
131
|
+
providerForStorage: 'Please connect your DID Spaces',
|
|
132
|
+
},
|
|
133
|
+
connected: {
|
|
134
|
+
title: 'Connected DID Spaces',
|
|
135
|
+
tag: 'Connected',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
87
139
|
},
|
|
88
140
|
};
|