@yeeyoon/library 3.2.8 → 3.2.9
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/components/AvatarPackaged/index.jsx +20 -12
- package/package.json +1 -1
- package/src/global.css +1 -1
- package/src/pages/index.js +9 -12
@@ -9,7 +9,8 @@ const defaultHeadUrl =
|
|
9
9
|
const defaultUserStyle = { border: '1px solid #fff' };
|
10
10
|
|
11
11
|
const AvatarInfo = ({
|
12
|
-
icon
|
12
|
+
icon,
|
13
|
+
id,
|
13
14
|
name,
|
14
15
|
placement = 'bottomRight',
|
15
16
|
showName = false,
|
@@ -21,26 +22,32 @@ const AvatarInfo = ({
|
|
21
22
|
}) => {
|
22
23
|
const CustomAvatar = (
|
23
24
|
<span>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
25
|
+
{icon || name || id ? (
|
26
|
+
<Avatar
|
27
|
+
size={size}
|
28
|
+
shape={shape}
|
29
|
+
className={styles['user-avatar-scale']}
|
30
|
+
src={icon || defaultHeadUrl}
|
31
|
+
style={{ ...defaultUserStyle, ...style }}
|
32
|
+
/>
|
33
|
+
) : null}
|
34
|
+
{showName &&
|
35
|
+
(icon || name || id ? (
|
36
|
+
<span className={styles['user-avatar-name']}>{name || '-'}</span>
|
37
|
+
) : (
|
38
|
+
'-'
|
39
|
+
))}
|
34
40
|
</span>
|
35
41
|
);
|
36
42
|
|
37
|
-
return showInfo ? (
|
43
|
+
return showInfo && id ? (
|
38
44
|
<Popover
|
39
45
|
placement={placement}
|
40
46
|
content={
|
41
47
|
<InfoCard
|
42
48
|
baseMsg={{
|
43
49
|
icon,
|
50
|
+
id,
|
44
51
|
name,
|
45
52
|
...rest,
|
46
53
|
}}
|
@@ -79,6 +86,7 @@ const AvatarPackaged = ({ data, maxCount = 5, maxStyle, ...rest }) => {
|
|
79
86
|
|
80
87
|
AvatarInfo.propTypes = {
|
81
88
|
icon: PropTypes.string,
|
89
|
+
id: PropTypes.string,
|
82
90
|
name: PropTypes.string,
|
83
91
|
showName: PropTypes.bool,
|
84
92
|
placement: PropTypes.string,
|
package/package.json
CHANGED
package/src/global.css
CHANGED
package/src/pages/index.js
CHANGED
@@ -1,17 +1,14 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { useState, useEffect } from 'react';
|
2
2
|
import Header from '../../lib/components/Header/';
|
3
|
-
import TenantSelector from '../../lib/components/TenantSelector';
|
4
3
|
|
5
4
|
// eslint-disable-next-line react/display-name
|
6
5
|
export default function () {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
</>
|
16
|
-
);
|
6
|
+
const [tenantId, setTenantId] = useState('');
|
7
|
+
useEffect(() => {
|
8
|
+
setTimeout(() => {
|
9
|
+
setTenantId('053a033a063711ecb0c00c42a1ff8370');
|
10
|
+
// setTenantId('f12a71b6063611ecb0c00c42a1ff8370');
|
11
|
+
}, 3000);
|
12
|
+
}, []);
|
13
|
+
return <Header productName="bpm" tenantId={tenantId} />;
|
17
14
|
}
|