tycho-components 0.14.5 → 0.14.6
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/dist/AppPlaceholder/style.scss +1 -1
- package/dist/Header/HeaderUser/HeaderUser.d.ts +1 -1
- package/dist/Header/HeaderUser/HeaderUser.js +9 -9
- package/dist/configs/Localization.d.ts +3 -0
- package/dist/configs/localization/HeaderTexts.d.ts +3 -0
- package/dist/configs/localization/HeaderTexts.js +3 -0
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from
|
|
3
|
-
import { useTranslation } from
|
|
4
|
-
import {
|
|
5
|
-
import { useLoggedUtils } from
|
|
6
|
-
import
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { Button, Icon, ProfileDropdown } from "tycho-storybook";
|
|
5
|
+
import { useLoggedUtils } from "../../configs/useLoggedUtils";
|
|
6
|
+
import "./style.scss";
|
|
7
7
|
export default function HeaderUser({ navigateLogout, navigateNotLogged, }) {
|
|
8
|
-
const { t } = useTranslation(
|
|
8
|
+
const { t } = useTranslation("header");
|
|
9
9
|
const { isLogged, getLogged } = useLoggedUtils();
|
|
10
10
|
const [open, setOpen] = useState(false);
|
|
11
11
|
const handleProfile = () => {
|
|
12
12
|
setOpen(false);
|
|
13
|
-
window.open(import.meta.env.VITE_APP_RESERVED_URL,
|
|
13
|
+
window.open(import.meta.env.VITE_APP_RESERVED_URL, "_blank");
|
|
14
14
|
};
|
|
15
|
-
return (_jsxs("div", { className: "header-user-container", children: [isLogged() ? (_jsx(ProfileDropdown, { src: getLogged()?.picture, title: getLogged()?.name || getLogged()?.sub, onClick: (b) => setOpen(b) })) : (_jsx(
|
|
15
|
+
return (_jsxs("div", { className: "header-user-container", children: [isLogged() ? (_jsx(ProfileDropdown, { src: getLogged()?.picture, title: getLogged()?.name || getLogged()?.sub, onClick: (b) => setOpen(b) })) : (_jsx(Button, { text: t("button.sign.in"), size: "small", onClick: navigateNotLogged })), open && isLogged() && (_jsxs("div", { className: "ds-dropdown-list", children: [_jsx("div", { className: "ds-dropdown-itemlist", children: _jsx("span", { className: "label", children: `${t("profile.label.hello")} ${getLogged()?.name || getLogged()?.sub}` }) }), _jsxs("div", { className: "ds-dropdown-itemlist d-none", children: [_jsx(Icon, { name: "colors", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.theme") })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: handleProfile, children: [_jsx(Icon, { name: "person", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.home") })] }), _jsxs("div", { className: "ds-dropdown-itemlist", children: [_jsx(Icon, { name: "live_help", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.help") })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => {
|
|
16
16
|
setOpen(false);
|
|
17
17
|
navigateLogout && navigateLogout();
|
|
18
|
-
}, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t(
|
|
18
|
+
}, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t("profile.label.logout") })] })] }))] }));
|
|
19
19
|
}
|
|
@@ -120,6 +120,7 @@ export declare const commonResources: {
|
|
|
120
120
|
"profile.label.help": string;
|
|
121
121
|
"profile.label.logout": string;
|
|
122
122
|
"profile.label.home": string;
|
|
123
|
+
"button.sign.in": string;
|
|
123
124
|
};
|
|
124
125
|
'header-app': {
|
|
125
126
|
'label.tools': string;
|
|
@@ -387,6 +388,7 @@ export declare const commonResources: {
|
|
|
387
388
|
"profile.label.help": string;
|
|
388
389
|
"profile.label.logout": string;
|
|
389
390
|
"profile.label.home": string;
|
|
391
|
+
"button.sign.in": string;
|
|
390
392
|
};
|
|
391
393
|
'header-app': {
|
|
392
394
|
'label.tools': string;
|
|
@@ -651,6 +653,7 @@ export declare const commonResources: {
|
|
|
651
653
|
"profile.label.help": string;
|
|
652
654
|
"profile.label.logout": string;
|
|
653
655
|
"profile.label.home": string;
|
|
656
|
+
"button.sign.in": string;
|
|
654
657
|
};
|
|
655
658
|
'header-app': {
|
|
656
659
|
'label.tools': string;
|
|
@@ -16,6 +16,7 @@ export declare const HeaderTexts: {
|
|
|
16
16
|
"profile.label.help": string;
|
|
17
17
|
"profile.label.logout": string;
|
|
18
18
|
"profile.label.home": string;
|
|
19
|
+
"button.sign.in": string;
|
|
19
20
|
};
|
|
20
21
|
"pt-BR": {
|
|
21
22
|
"label.platform": string;
|
|
@@ -34,6 +35,7 @@ export declare const HeaderTexts: {
|
|
|
34
35
|
"profile.label.help": string;
|
|
35
36
|
"profile.label.logout": string;
|
|
36
37
|
"profile.label.home": string;
|
|
38
|
+
"button.sign.in": string;
|
|
37
39
|
};
|
|
38
40
|
it: {
|
|
39
41
|
"label.platform": string;
|
|
@@ -52,5 +54,6 @@ export declare const HeaderTexts: {
|
|
|
52
54
|
"profile.label.help": string;
|
|
53
55
|
"profile.label.logout": string;
|
|
54
56
|
"profile.label.home": string;
|
|
57
|
+
"button.sign.in": string;
|
|
55
58
|
};
|
|
56
59
|
};
|
|
@@ -16,6 +16,7 @@ export const HeaderTexts = {
|
|
|
16
16
|
"profile.label.help": "Help Center",
|
|
17
17
|
"profile.label.logout": "Logout",
|
|
18
18
|
"profile.label.home": "My profile",
|
|
19
|
+
"button.sign.in": "Sign In",
|
|
19
20
|
},
|
|
20
21
|
"pt-BR": {
|
|
21
22
|
"label.platform": "Plataforma Tycho Brahe",
|
|
@@ -34,6 +35,7 @@ export const HeaderTexts = {
|
|
|
34
35
|
"profile.label.help": "Central de Ajuda",
|
|
35
36
|
"profile.label.logout": "Sair da conta",
|
|
36
37
|
"profile.label.home": "Meu perfil",
|
|
38
|
+
"button.sign.in": "Entrar",
|
|
37
39
|
},
|
|
38
40
|
it: {
|
|
39
41
|
"label.platform": "Piattaforma Tycho Brahe",
|
|
@@ -52,5 +54,6 @@ export const HeaderTexts = {
|
|
|
52
54
|
"profile.label.help": "Centro assistenza",
|
|
53
55
|
"profile.label.logout": "Disconnetti",
|
|
54
56
|
"profile.label.home": "Il mio profilo",
|
|
57
|
+
"button.sign.in": "Accedi",
|
|
55
58
|
},
|
|
56
59
|
};
|