cfel-base-components 2.5.0 → 2.5.1
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/package.json
CHANGED
|
@@ -12,6 +12,7 @@ export interface LiosLayoutlProps {
|
|
|
12
12
|
menuList: any;
|
|
13
13
|
onMenuClick: (item: any) => void;
|
|
14
14
|
selectedKeys: string[];
|
|
15
|
+
customAction: (item: any) => void;
|
|
15
16
|
actions?: any[];
|
|
16
17
|
myWalletInfo?: {
|
|
17
18
|
availableCashAmount: string;
|
|
@@ -36,6 +37,8 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
36
37
|
menuList,
|
|
37
38
|
onMenuClick,
|
|
38
39
|
selectedKeys,
|
|
40
|
+
|
|
41
|
+
customAction,
|
|
39
42
|
actions,
|
|
40
43
|
|
|
41
44
|
defaultOpenKeys,
|
|
@@ -64,14 +67,14 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
64
67
|
<Sider
|
|
65
68
|
className="layout-side"
|
|
66
69
|
style={{
|
|
67
|
-
backgroundSize: collapsed ? "
|
|
70
|
+
backgroundSize: collapsed ? "1800%" : "900%",
|
|
68
71
|
}}
|
|
69
72
|
collapsible
|
|
70
73
|
collapsed={collapsed}
|
|
71
74
|
width={240}
|
|
72
|
-
onCollapse={(value) =>{
|
|
75
|
+
onCollapse={(value) => {
|
|
73
76
|
localStorage.setItem("layout_collapsed", value.toString());
|
|
74
|
-
setCollapsed(value)
|
|
77
|
+
setCollapsed(value);
|
|
75
78
|
}}
|
|
76
79
|
>
|
|
77
80
|
<div className="layout-logo">
|
|
@@ -136,7 +139,11 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
136
139
|
<Popover
|
|
137
140
|
placement="bottom"
|
|
138
141
|
content={
|
|
139
|
-
<UserCard
|
|
142
|
+
<UserCard
|
|
143
|
+
myWalletInfo={myWalletInfo}
|
|
144
|
+
amountInfo={amountInfo}
|
|
145
|
+
customAction={customAction}
|
|
146
|
+
/>
|
|
140
147
|
}
|
|
141
148
|
arrow={false}
|
|
142
149
|
trigger="click"
|
|
@@ -39,30 +39,22 @@ const renderCurrency = (currency: string) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export default function UserCard({
|
|
42
|
+
export default function UserCard({
|
|
43
|
+
myWalletInfo,
|
|
44
|
+
amountInfo,
|
|
45
|
+
customAction,
|
|
46
|
+
}: any) {
|
|
43
47
|
const { user, custom, switchTenantUrl, logoutUrl } = (window as any)
|
|
44
48
|
?.g_config;
|
|
45
49
|
|
|
46
50
|
const { name, avatar, tenantName, role }: UserType = user || {};
|
|
47
|
-
|
|
48
|
-
const { isCompleted, isAudited
|
|
49
|
-
custom || {};
|
|
51
|
+
|
|
52
|
+
const { isCompleted, isAudited }: CustomType = custom || {};
|
|
50
53
|
|
|
51
54
|
const { availableCashAmount, availableAmount, currency }: MyWalletInfoType =
|
|
52
55
|
myWalletInfo || {};
|
|
53
56
|
const { residueNum, currencyCode }: AmountInfoType = amountInfo || {};
|
|
54
57
|
|
|
55
|
-
const editUserInfo = () => {
|
|
56
|
-
const { origin } = window.location;
|
|
57
|
-
if (historyAction) {
|
|
58
|
-
historyAction?.push({
|
|
59
|
-
pathname: hrefUrl,
|
|
60
|
-
});
|
|
61
|
-
} else {
|
|
62
|
-
window.location.href = origin + hrefUrl;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
58
|
const UserCard = () => {
|
|
67
59
|
return (
|
|
68
60
|
<div className="layout-user-card">
|
|
@@ -116,7 +108,7 @@ export default function UserCard({ myWalletInfo, amountInfo }) {
|
|
|
116
108
|
<div
|
|
117
109
|
className="lios-icon"
|
|
118
110
|
onClick={() => {
|
|
119
|
-
|
|
111
|
+
customAction && customAction();
|
|
120
112
|
}}
|
|
121
113
|
>
|
|
122
114
|
<FormOutlined />
|