tycho-components 0.0.17-SNAPSHOT-8 → 0.0.17-SNAPSHOT-10
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.
|
@@ -4,13 +4,15 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import { Avatar, Icon, ProfileDropdown } from 'tycho-storybook';
|
|
5
5
|
import { useLoggedUtils } from '../../configs/useLoggedUtils';
|
|
6
6
|
import './style.scss';
|
|
7
|
+
import { useNavigate } from 'react-router-dom';
|
|
7
8
|
export default function HeaderUser({ navigateLogout }) {
|
|
8
9
|
const { t } = useTranslation('header');
|
|
9
10
|
const { isLogged, getLogged } = useLoggedUtils();
|
|
11
|
+
const navigate = useNavigate();
|
|
10
12
|
const [open, setOpen] = useState(false);
|
|
11
13
|
const handleProfile = () => {
|
|
12
14
|
setOpen(false);
|
|
13
15
|
window.open(import.meta.env.VITE_APP_PROFILE_URL, '_blank');
|
|
14
16
|
};
|
|
15
|
-
return (_jsxs("div", { className: "header-user-container", children: [isLogged() ? (_jsx(ProfileDropdown, { src: getLogged()?.picture, title: getLogged()?.name, onClick: (b) => setOpen(b) })) : (_jsx(Avatar, { size: "small" })), 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}` }) }), _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: navigateLogout, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.logout') })] })] }))] }));
|
|
17
|
+
return (_jsxs("div", { className: "header-user-container", children: [isLogged() ? (_jsx(ProfileDropdown, { src: getLogged()?.picture, title: getLogged()?.name, onClick: (b) => setOpen(b) })) : (_jsx(Avatar, { size: "small", onClick: () => navigate('/auth') })), 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}` }) }), _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: navigateLogout, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.logout') })] })] }))] }));
|
|
16
18
|
}
|
package/dist/Header/styles.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.17-SNAPSHOT-
|
|
4
|
+
"version": "0.0.17-SNAPSHOT-10",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-hook-form": "^7.45.2",
|
|
50
50
|
"react-i18next": "^13.0.2",
|
|
51
51
|
"react-router-dom": "^6.14.2",
|
|
52
|
-
"tycho-storybook": "0.1.7-
|
|
52
|
+
"tycho-storybook": "0.1.7-r4",
|
|
53
53
|
"yup": "^1.2.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|