@irontec/ivoz-ui 1.7.8 → 1.7.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/components/layout/Header/Header.js +22 -6
- package/css/main.css +6 -0
- package/package.json +2 -1
- package/store/aboutInfo.d.ts +14 -0
- package/store/aboutInfo.js +16 -0
- package/store/index.d.ts +2 -0
- package/store/index.js +2 -0
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
3
|
-
import { Box, MenuItem, Typography, useMediaQuery, useTheme, } from '@mui/material';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { Box, Dialog, DialogActions, DialogContent, MenuItem, Typography, useMediaQuery, useTheme, } from '@mui/material';
|
|
4
|
+
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
|
|
5
|
+
import { LightButton, SolidButton, } from '../../../components/shared/Button/Button.styles';
|
|
6
|
+
import { useStoreActions, useStoreState } from '../../../store';
|
|
6
7
|
import Avatar from './Avatar';
|
|
7
8
|
import Breadcrumbs from './Breadcrumbs';
|
|
8
9
|
import Settings from './Settings/Settings';
|
|
9
10
|
import _ from '../../../services/translations/translate';
|
|
11
|
+
import { useState } from 'react';
|
|
12
|
+
import Logo from '../Menu/Logo';
|
|
10
13
|
export default function Header(props) {
|
|
11
14
|
const { routeMap, className } = props;
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
12
16
|
const resetAuth = useStoreActions((actions) => actions.auth.resetAll);
|
|
13
17
|
const toggleVisibility = useStoreActions((actions) => actions.menu.toggleVisibility);
|
|
18
|
+
const logo = useStoreState((state) => state.theme.logo);
|
|
19
|
+
const version = useStoreState((state) => state.aboutInfo.version);
|
|
20
|
+
const lastUpdated = useStoreState((state) => state.aboutInfo.lastUpdated);
|
|
21
|
+
const commit = useStoreState((state) => state.aboutInfo.commit);
|
|
14
22
|
const handleLogout = () => {
|
|
15
23
|
resetAuth();
|
|
16
24
|
};
|
|
17
25
|
const theme = useTheme();
|
|
18
26
|
const desktop = useMediaQuery(theme.breakpoints.up('md'));
|
|
19
|
-
|
|
27
|
+
const handleModal = () => {
|
|
28
|
+
setOpen(!open);
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs(Box, Object.assign({ className: className }, { children: [_jsx(Box, Object.assign({ className: 'start' }, { children: _jsx(Breadcrumbs, { desktop: desktop, routeMap: routeMap }) })), _jsxs(Box, Object.assign({ className: 'end' }, { children: [desktop && (_jsxs(_Fragment, { children: [_jsx(Settings, {}), _jsxs(Avatar, { children: [_jsx(MenuItem, Object.assign({ onClick: handleModal }, { children: _jsx(Typography, Object.assign({ textAlign: 'center' }, { children: _('About') })) }), 'about'), _jsx(MenuItem, Object.assign({ onClick: handleLogout }, { children: _jsx(Typography, Object.assign({ textAlign: 'center' }, { children: _('Logout') })) }), 'logout')] })] })), !desktop && (_jsx(LightButton, Object.assign({ onClick: () => {
|
|
20
31
|
toggleVisibility();
|
|
21
|
-
} }, { children: _jsx(MenuIcon, {}) })))
|
|
32
|
+
} }, { children: _jsx(MenuIcon, {}) }))), open && (_jsxs(Dialog, Object.assign({ open: open, onClose: handleModal, keepMounted: true, "aria-labelledby": 'dialog-about', "aria-describedby": 'dialog-about' }, { children: [_jsx(CloseRoundedIcon, { className: 'close-icon', onClick: handleModal }), _jsxs(DialogContent, Object.assign({ className: 'dialog-about' }, { children: [_jsx("p", { children: _jsx("img", { src: logo || './logo.svg', className: 'logo' }) }), _jsxs("p", { children: [_('Version'), ": ", version, " (", commit, ") ", _jsx("br", {}), _('Last update'), ": ", lastUpdated] }), _jsx("p", { children: _jsxs(Box, Object.assign({ sx: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
gap: 1,
|
|
37
|
+
}, className: 'logo' }, { children: ["Powered by ", _jsx(Logo, {})] })) }), _jsx("p", { children: "\u00A92025 Irontec | All rights reserved" })] })), _jsx(DialogActions, { children: _jsx(SolidButton, Object.assign({ onClick: handleModal, sx: { width: '100%' } }, { children: _('ACCEPT') })) })] })))] }))] })));
|
|
22
38
|
}
|
package/css/main.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@irontec/ivoz-ui",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
4
4
|
"description": "UI library used in ivozprovider",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@date-io/date-fns": "^2.10.8",
|
|
49
|
+
"@irontec/ivoz-ui": "^1.7.8",
|
|
49
50
|
"@types/react-color": "^3.0.12",
|
|
50
51
|
"axios": "^0.21.1",
|
|
51
52
|
"date-fns": "^2.21.1",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from 'easy-peasy';
|
|
2
|
+
interface AboutInfoState {
|
|
3
|
+
version: string;
|
|
4
|
+
commit: string;
|
|
5
|
+
lastUpdated: string;
|
|
6
|
+
}
|
|
7
|
+
interface AboutInfoActions {
|
|
8
|
+
setVersion: Action<AboutInfoState, string>;
|
|
9
|
+
setCommit: Action<AboutInfoState, string>;
|
|
10
|
+
setLastUpdated: Action<AboutInfoState, string>;
|
|
11
|
+
}
|
|
12
|
+
export declare type AboutInfoStore = AboutInfoActions & AboutInfoState;
|
|
13
|
+
declare const aboutInfo: AboutInfoStore;
|
|
14
|
+
export default aboutInfo;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { action } from 'easy-peasy';
|
|
2
|
+
const aboutInfo = {
|
|
3
|
+
version: 'development',
|
|
4
|
+
commit: 'HEAD',
|
|
5
|
+
lastUpdated: 'now',
|
|
6
|
+
setVersion: action((state, version) => {
|
|
7
|
+
state.version = version;
|
|
8
|
+
}),
|
|
9
|
+
setCommit: action((state, commit) => {
|
|
10
|
+
state.commit = commit;
|
|
11
|
+
}),
|
|
12
|
+
setLastUpdated: action((state, lastUpdated) => {
|
|
13
|
+
state.lastUpdated = lastUpdated;
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
export default aboutInfo;
|
package/store/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { MenuStore } from './menu';
|
|
|
12
12
|
import { ThemeStore } from './theme';
|
|
13
13
|
import { EntitiesStore } from './entities';
|
|
14
14
|
import { LanguagesStore } from './i18n';
|
|
15
|
+
import { AboutInfoStore } from './aboutInfo';
|
|
15
16
|
export interface IvozStore {
|
|
16
17
|
auth: AuthStore;
|
|
17
18
|
spec: SpecStore;
|
|
@@ -25,6 +26,7 @@ export interface IvozStore {
|
|
|
25
26
|
entities: EntitiesStore;
|
|
26
27
|
i18n: LanguagesStore;
|
|
27
28
|
theme: ThemeStore;
|
|
29
|
+
aboutInfo: AboutInfoStore;
|
|
28
30
|
}
|
|
29
31
|
export declare type IvozStoreState = StateMapper<FilterActionTypes<IvozStore>>;
|
|
30
32
|
export declare const storeModel: IvozStore;
|
package/store/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import menu from './menu';
|
|
|
12
12
|
import theme from './theme';
|
|
13
13
|
import entities from './entities';
|
|
14
14
|
import i18n from './i18n';
|
|
15
|
+
import aboutInfo from './aboutInfo';
|
|
15
16
|
export const storeModel = {
|
|
16
17
|
auth,
|
|
17
18
|
spec,
|
|
@@ -25,6 +26,7 @@ export const storeModel = {
|
|
|
25
26
|
entities,
|
|
26
27
|
i18n,
|
|
27
28
|
theme,
|
|
29
|
+
aboutInfo,
|
|
28
30
|
};
|
|
29
31
|
StoreContainer.store = createStore(storeModel);
|
|
30
32
|
const { useStoreActions, useStoreState, useStoreDispatch, useStore } = createTypedHooks();
|