@antscorp/antsomi-ui 1.3.5-beta.356 → 1.3.5-beta.357
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.
|
@@ -24,10 +24,10 @@ import Icon from '@antscorp/icons';
|
|
|
24
24
|
import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
|
|
25
25
|
import { DEFAULT_TRANSLATE_DATA } from './constant';
|
|
26
26
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
27
|
-
const STEP = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
27
|
+
// const STEP = {
|
|
28
|
+
// SWITCH_ACCOUNT: 'SWITCH_ACCOUNT',
|
|
29
|
+
// SELECT_NETWORK: 'SELECT_NETWORK',
|
|
30
|
+
// };
|
|
31
31
|
const InputSearch = props => {
|
|
32
32
|
const { value, onChange, className, onClickRemove } = props;
|
|
33
33
|
return (React.createElement(InputSearchStyled, { className: className || '' },
|
|
@@ -46,7 +46,7 @@ export const AccountSharing = props => {
|
|
|
46
46
|
const [isShowLoading, setIsShowLoading] = useState(false);
|
|
47
47
|
const [accountSearch, setAccountSearch] = useState('');
|
|
48
48
|
const [portalSearch, setPortalSearch] = useState('');
|
|
49
|
-
const [
|
|
49
|
+
const [tab, setTab] = useState('account');
|
|
50
50
|
const [listNetworks, setListNetworks] = useState([]);
|
|
51
51
|
const [currentNetwork, setCurrentNetwork] = useState();
|
|
52
52
|
const [serverTranslateData, setServerTranslateData] = useState({});
|
|
@@ -200,10 +200,7 @@ export const AccountSharing = props => {
|
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
}, [limitAccount]);
|
|
203
|
-
const filterListNetwork = useMemo(() =>
|
|
204
|
-
const draftListNetwork = [...listNetworks];
|
|
205
|
-
return draftListNetwork.filter((netWork) => netWork.networkName.toLocaleLowerCase().indexOf(portalSearch.toLocaleLowerCase()) !== -1);
|
|
206
|
-
}, [listNetworks, portalSearch]);
|
|
203
|
+
const filterListNetwork = useMemo(() => listNetworks.filter((netWork) => netWork.networkName.toLocaleLowerCase().indexOf(portalSearch.toLocaleLowerCase()) !== -1), [listNetworks, portalSearch]);
|
|
207
204
|
const logAccountSwitch = (switchAccountId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
208
205
|
// setIsShowLoading(true)
|
|
209
206
|
if (switchAccountId && isShareAccountAccess) {
|
|
@@ -231,9 +228,6 @@ export const AccountSharing = props => {
|
|
|
231
228
|
window.location.href = urlLogout;
|
|
232
229
|
}, 300);
|
|
233
230
|
};
|
|
234
|
-
const switchStep = toStep => {
|
|
235
|
-
setStep(toStep);
|
|
236
|
-
};
|
|
237
231
|
function urlDomain(data) {
|
|
238
232
|
const a = document.createElement('a');
|
|
239
233
|
a.href = data;
|
|
@@ -382,19 +376,18 @@ export const AccountSharing = props => {
|
|
|
382
376
|
React.createElement(Text, { className: "account-number" }, formatUserId(account.user_id)))));
|
|
383
377
|
return (React.createElement(CookiesProvider, null,
|
|
384
378
|
React.createElement(Popover, { content: React.createElement(PackageSharingStyled, null,
|
|
385
|
-
React.createElement("div", { className: "
|
|
386
|
-
React.createElement("div", { className: "
|
|
379
|
+
React.createElement("div", { className: "info-account" }, infoAccount ? (React.createElement(React.Fragment, null,
|
|
380
|
+
React.createElement("div", { className: "current-account-avatar" },
|
|
387
381
|
React.createElement("img", { src: infoAccount.avatar, alt: "" }),
|
|
388
382
|
React.createElement("a", { className: "edit-profile", href: urlEditProfile, target: "_blank", rel: "noreferrer" },
|
|
389
383
|
React.createElement(Icon, { type: "icon-ants-edit-2", style: { color: '#aaa' } }))),
|
|
390
|
-
React.createElement("
|
|
391
|
-
|
|
392
|
-
React.createElement("p", { style: { color: '#aaa', marginTop: 2 } }, infoAccount.email)))) : (React.createElement("div", null,
|
|
384
|
+
React.createElement("p", { style: { fontWeight: 600 } }, infoAccount.full_name),
|
|
385
|
+
React.createElement("p", { style: { color: '#aaa', marginTop: 2 } }, infoAccount.email))) : (React.createElement("div", null,
|
|
393
386
|
translateLang('KEY_LOADING'),
|
|
394
387
|
"..."))),
|
|
395
388
|
React.createElement(InnerCardStyled, null,
|
|
396
|
-
React.createElement("div", { className: "network-block" },
|
|
397
|
-
currentNetwork
|
|
389
|
+
React.createElement("div", { className: "network-block" }, tab === 'account' ? (React.createElement("div", { className: "current-network" },
|
|
390
|
+
(currentNetwork === null || currentNetwork === void 0 ? void 0 : currentNetwork.logo) ? (React.createElement("div", null,
|
|
398
391
|
React.createElement("img", { src: currentNetwork.logo, style: {
|
|
399
392
|
maxHeight: 28,
|
|
400
393
|
maxWidth: 200,
|
|
@@ -402,26 +395,21 @@ export const AccountSharing = props => {
|
|
|
402
395
|
border: 'none',
|
|
403
396
|
boxShadow: 'none',
|
|
404
397
|
}, alt: "network-logo" }))) : null,
|
|
405
|
-
React.createElement(Button, { type: "text", className: "change-network-btn", onClick: () =>
|
|
398
|
+
React.createElement(Button, { type: "text", className: "change-network-btn", onClick: () => setTab('network'), icon: React.createElement(Icon, { type: "icon-ants-angle-right", style: { fontSize: '12px' } }) }, translateLang('KEY_CHANGE_PORTAL')))) : (React.createElement(React.Fragment, null,
|
|
406
399
|
React.createElement(Flex, { gap: 10 },
|
|
407
|
-
React.createElement(Button, { type: "text", onClick: () =>
|
|
408
|
-
React.createElement(InputSearch, { className: "--portal",
|
|
409
|
-
|
|
400
|
+
React.createElement(Button, { type: "text", onClick: () => setTab('account'), icon: React.createElement(Icon, { type: "icon-ants-angle-left", style: { fontSize: '12px' } }) }, translateLang('KEY_BACK')),
|
|
401
|
+
React.createElement(InputSearch, { className: "--portal", value: portalSearch, onChange: value => setPortalSearch(value), onClickRemove: () => setPortalSearch('') })),
|
|
402
|
+
React.createElement("div", { className: "network-select" }, filterListNetwork === null || filterListNetwork === void 0 ? void 0 : filterListNetwork.map((network) => (React.createElement("div", { key: network.networkId, className: `network-item ${networkId === +network.networkId ? 'disabled' : ''}`, onClick: () => selectNetwork(network) },
|
|
410
403
|
React.createElement("div", { className: "image-wrapper" },
|
|
411
404
|
React.createElement("img", { src: network.logo, style: {
|
|
412
|
-
// maxWidth: 55,
|
|
413
|
-
// maxHeight: 55,
|
|
414
405
|
borderRadius: 0,
|
|
415
406
|
border: 'none',
|
|
416
407
|
boxShadow: 'none',
|
|
417
408
|
}, alt: "logo" })),
|
|
418
|
-
React.createElement("p", { className: "network-name" }, network.networkName)))))
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
} },
|
|
423
|
-
React.createElement("p", { style: { fontSize: 12, color: '#aaa', margin: 0 } }, "No networks")))))),
|
|
424
|
-
step === STEP.SWITCH_ACCOUNT ? (isShowSharing ? (React.createElement("div", { className: "div-cover-account" },
|
|
409
|
+
React.createElement("p", { className: "network-name" }, network.networkName))))),
|
|
410
|
+
React.createElement("div", { className: "no-network-title" },
|
|
411
|
+
React.createElement("span", null, "No networks"))))),
|
|
412
|
+
tab === 'account' ? (isShowSharing ? (React.createElement("div", { className: "div-cover-account" },
|
|
425
413
|
isShowLoading ? React.createElement(Spin, null) : null,
|
|
426
414
|
React.createElement(InputSearch, { value: accountSearch, onChange: value => setAccountSearch(value), onClickRemove: () => {
|
|
427
415
|
setAccountSearch('');
|
|
@@ -110,14 +110,18 @@ export const PackageSharingStyled = styled.div `
|
|
|
110
110
|
min-width: 400px;
|
|
111
111
|
max-width: 400px;
|
|
112
112
|
|
|
113
|
-
.
|
|
113
|
+
.info-account {
|
|
114
114
|
display: flex;
|
|
115
115
|
flex-direction: column;
|
|
116
116
|
align-items: center;
|
|
117
117
|
text-align: center;
|
|
118
118
|
width: 370px;
|
|
119
|
+
margin-bottom: 15px;
|
|
120
|
+
p {
|
|
121
|
+
margin: 0;
|
|
122
|
+
}
|
|
119
123
|
|
|
120
|
-
.
|
|
124
|
+
.current-account-avatar {
|
|
121
125
|
position: relative;
|
|
122
126
|
margin-bottom: 10px;
|
|
123
127
|
|
|
@@ -145,17 +149,12 @@ export const PackageSharingStyled = styled.div `
|
|
|
145
149
|
cursor: pointer;
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
line-height: 18px;
|
|
155
|
-
}
|
|
156
|
-
& > p:last-child {
|
|
157
|
-
line-height: 13px;
|
|
158
|
-
}
|
|
152
|
+
|
|
153
|
+
p:first-child {
|
|
154
|
+
line-height: 18px;
|
|
155
|
+
}
|
|
156
|
+
p:last-child {
|
|
157
|
+
line-height: 13px;
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
.div-cover-account {
|
|
@@ -282,7 +281,6 @@ export const PackageSharingStyled = styled.div `
|
|
|
282
281
|
cursor: pointer;
|
|
283
282
|
&:hover {
|
|
284
283
|
.image-wrapper {
|
|
285
|
-
/* box-shadow: 1px 1px 2px 0 #aaa; */
|
|
286
284
|
background-color: ${(_f = THEME.token) === null || _f === void 0 ? void 0 : _f.blue};
|
|
287
285
|
border-color: ${(_g = THEME.token) === null || _g === void 0 ? void 0 : _g.blue3};
|
|
288
286
|
}
|
|
@@ -323,6 +321,17 @@ export const PackageSharingStyled = styled.div `
|
|
|
323
321
|
}
|
|
324
322
|
}
|
|
325
323
|
}
|
|
324
|
+
|
|
325
|
+
.no-network-title {
|
|
326
|
+
height: 158px;
|
|
327
|
+
display: flex;
|
|
328
|
+
justify-content: center;
|
|
329
|
+
align-items: center;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.network-select:has(> div.network-item) + .no-network-title {
|
|
333
|
+
display: none;
|
|
334
|
+
}
|
|
326
335
|
}
|
|
327
336
|
`;
|
|
328
337
|
export const InnerCardStyled = styled.div `
|