@omniumretail/component-library 1.0.75 → 1.0.76
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
|
@@ -26,10 +26,11 @@ const Template: Story<any> = (args) => {
|
|
|
26
26
|
"NChildren": "2",
|
|
27
27
|
"Workload": "2 horas",
|
|
28
28
|
"Description": "One Desccription",
|
|
29
|
-
"Comments": "One CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne Commentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"
|
|
29
|
+
"Comments": "One CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne CommentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwOne Commentsdwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww",
|
|
30
|
+
"Image": "https://omnium-user-images.s3.eu-west-1.amazonaws.com/Users/.jpg"
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
return <UserInfo {...args} userData={data} userName={ "Diogo Carvalho" } userCode={ "121212" } userInfoTranslationsKey={'userInfoColumn'}></UserInfo>;
|
|
33
|
+
return <UserInfo {...args} userData={data} userName={ "Diogo Carvalho" } userCode={ "121212" } userImage={"https://omnium-user-images.s3.eu-west-1.amazonaws.com/Users/.jpg"} userInfoTranslationsKey={'userInfoColumn'}></UserInfo>;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export const Primary = Template.bind({});
|
|
@@ -5,58 +5,73 @@ import { Label } from '../Label';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
7
|
export interface UserInfoProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
userData: any;
|
|
9
|
+
userImage: string;
|
|
10
|
+
userName: string;
|
|
11
|
+
userCode: string;
|
|
12
|
+
userInfoTranslationsKey?: string;
|
|
13
|
+
customClass?: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export const UserInfo = ({
|
|
16
|
-
|
|
16
|
+
export const UserInfo = ({
|
|
17
|
+
userData,
|
|
18
|
+
customClass,
|
|
19
|
+
userImage,
|
|
20
|
+
userName,
|
|
21
|
+
userCode,
|
|
22
|
+
userInfoTranslationsKey,
|
|
23
|
+
}: UserInfoProps) => {
|
|
24
|
+
const { t } = useTranslation();
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
const userInfoStyle = classNames(
|
|
27
|
+
{
|
|
28
|
+
[`${customClass}`]: customClass,
|
|
29
|
+
},
|
|
30
|
+
[styles.userInfo]
|
|
31
|
+
);
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{userName}
|
|
26
|
-
</Label>
|
|
33
|
+
return (
|
|
34
|
+
<div className={userInfoStyle}>
|
|
35
|
+
<img src={userImage} />
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
<Label customStyle={styles.userName}>{userName}</Label>
|
|
38
|
+
|
|
39
|
+
<h3 className={styles.userCode}>{userCode}</h3>
|
|
40
|
+
|
|
41
|
+
{Object.entries(userData)?.map(([key, value]: any) => {
|
|
42
|
+
if (
|
|
43
|
+
userInfoTranslationsKey &&
|
|
44
|
+
t(`${userInfoTranslationsKey}.${key}`) === `${userInfoTranslationsKey}.${key}`
|
|
45
|
+
) {
|
|
46
|
+
// Verificar se a chave de tradução não existe
|
|
47
|
+
return null; // Pular a renderização desse campo
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (key === 'Store') {
|
|
51
|
+
return (
|
|
52
|
+
<div key={key}>
|
|
53
|
+
<h3 className={styles.userInfoTitles}>
|
|
54
|
+
{userInfoTranslationsKey ? t(`${userInfoTranslationsKey}.${key}`) : key}
|
|
55
|
+
</h3>
|
|
56
|
+
{value?.map((store: string, index: number) => (
|
|
57
|
+
<h3 key={`${key}-${index}`} className={styles.userInfoDesc}>
|
|
58
|
+
{store}
|
|
59
|
+
</h3>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div key={key}>
|
|
67
|
+
<h3 className={styles.userInfoTitles}>
|
|
68
|
+
{userInfoTranslationsKey ? t(`${userInfoTranslationsKey}.${key}`) : key}
|
|
30
69
|
</h3>
|
|
31
70
|
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</h3>
|
|
39
|
-
{value?.map((store: string, index: number) => (
|
|
40
|
-
<h3 key={`${key}-${index}`} className={styles.userInfoDesc}>
|
|
41
|
-
{store}
|
|
42
|
-
</h3>
|
|
43
|
-
))}
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div key={key}>
|
|
50
|
-
<h3 className={styles.userInfoTitles}>
|
|
51
|
-
{userInfoTranslationsKey ? t(`${userInfoTranslationsKey}.${key}`) : key}
|
|
52
|
-
</h3>
|
|
53
|
-
|
|
54
|
-
<h3 className={styles.userInfoDesc}>
|
|
55
|
-
{value as string}
|
|
56
|
-
</h3>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
})}
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
71
|
+
<h3 className={styles.userInfoDesc}>{value as string}</h3>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
62
77
|
};
|