tycho-components 0.0.18-r1 → 0.0.18-r3
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ReactLoading from 'react-loading';
|
|
3
3
|
import './style.scss';
|
|
4
|
-
function AppLoading() {
|
|
4
|
+
export default function AppLoading() {
|
|
5
5
|
return (_jsx("div", { className: "loading-container", children: _jsx(ReactLoading, { type: "spinningBubbles", color: "blue", height: 50, width: 50 }) }));
|
|
6
6
|
}
|
|
7
|
-
export default AppLoading;
|
package/dist/Header/Header.js
CHANGED
|
@@ -12,10 +12,12 @@ import HeaderReplaceAll from './HeaderReplaceAll';
|
|
|
12
12
|
import HeaderUser from './HeaderUser';
|
|
13
13
|
import './styles.scss';
|
|
14
14
|
import HeaderNotifications from '../Comments/HeaderNotifications';
|
|
15
|
+
import { useLoggedUtils } from '../configs/useLoggedUtils';
|
|
15
16
|
const linkTurorials = 'https://www.tycho.iel.unicamp.br/home/tutorials';
|
|
16
17
|
export default function Header({ tool, navigateHome, navigateCorpora, navigateLogout, redirect, autoload, freeAccess, hideKeyboard, hideReplaceAll, customHeader, notifications, }) {
|
|
17
18
|
const { t } = useTranslation('header');
|
|
18
19
|
const { getCorpus, hasCorpus } = useCorpusUtils();
|
|
20
|
+
const { isLogged } = useLoggedUtils();
|
|
19
21
|
const [openKeyboard, setOpenKeyboard] = useState(false);
|
|
20
22
|
const profileClass = cx('header-profile', {
|
|
21
23
|
'corpora-free': freeAccess && !hasCorpus(),
|
|
@@ -23,5 +25,5 @@ export default function Header({ tool, navigateHome, navigateCorpora, navigateLo
|
|
|
23
25
|
const homeTextsClass = cx('texts', {
|
|
24
26
|
pointer: navigateHome !== undefined,
|
|
25
27
|
});
|
|
26
|
-
return (_jsxs("div", { className: "ds-header", children: [_jsx(HeaderApps, { freeAccess: freeAccess }), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] }), customHeader, !customHeader && (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, freeAccess: freeAccess, navigateCorpora: navigateCorpora })), _jsxs("div", { className: profileClass, children: [!hideReplaceAll && _jsx(HeaderReplaceAll, {}), !hideKeyboard && (_jsx(IconButton, { onClick: () => setOpenKeyboard(!openKeyboard), name: "keyboard", size: "medium", title: t('tooltip.keyboard') })), _jsx(IconButton, { name: "live_help", size: "medium", title: t('tooltip.tutorials'), onClick: () => window.open(linkTurorials, '_blank') }), notifications && (_jsx(HeaderNotifications, { uid: notifications.ref, mode: notifications.mode })), _jsx(LanguageSelector, {}), !freeAccess && _jsx(HeaderUser, { navigateLogout: navigateLogout })] }), openKeyboard && (_jsx(VirtualKeyboard, { onClose: () => setOpenKeyboard(false), closeLabel: t('button.close'), defaultLayout: getCorpus().keyboardLayout || 'english' }))] }));
|
|
28
|
+
return (_jsxs("div", { className: "ds-header", children: [_jsx(HeaderApps, { freeAccess: freeAccess }), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] }), customHeader, !customHeader && (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, freeAccess: freeAccess, navigateCorpora: navigateCorpora })), _jsxs("div", { className: profileClass, children: [!hideReplaceAll && _jsx(HeaderReplaceAll, {}), !hideKeyboard && (_jsx(IconButton, { onClick: () => setOpenKeyboard(!openKeyboard), name: "keyboard", size: "medium", title: t('tooltip.keyboard') })), _jsx(IconButton, { name: "live_help", size: "medium", title: t('tooltip.tutorials'), onClick: () => window.open(linkTurorials, '_blank') }), notifications && isLogged() && (_jsx(HeaderNotifications, { uid: notifications.ref, mode: notifications.mode })), _jsx(LanguageSelector, {}), !freeAccess && _jsx(HeaderUser, { navigateLogout: navigateLogout })] }), openKeyboard && (_jsx(VirtualKeyboard, { onClose: () => setOpenKeyboard(false), closeLabel: t('button.close'), defaultLayout: getCorpus().keyboardLayout || 'english' }))] }));
|
|
27
29
|
}
|
|
@@ -12,5 +12,8 @@ export default function HeaderUser({ navigateLogout }) {
|
|
|
12
12
|
setOpen(false);
|
|
13
13
|
window.open(import.meta.env.VITE_APP_PROFILE_URL, '_blank');
|
|
14
14
|
};
|
|
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", onClick: () => (location.href = '/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:
|
|
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", onClick: () => (location.href = '/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: () => {
|
|
16
|
+
setOpen(false);
|
|
17
|
+
navigateLogout && navigateLogout();
|
|
18
|
+
}, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.logout') })] })] }))] }));
|
|
16
19
|
}
|