@antscorp/antsomi-ui 1.3.5-beta.260 → 1.3.5-beta.261
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/es/components/organism/LeftMenu/components/CommonMenu/index.d.ts +2 -0
- package/es/components/organism/LeftMenu/components/{InsightsMenu/useInsightsMenu.js → CommonMenu/index.js} +8 -9
- package/es/components/organism/LeftMenu/components/HomeMenu/index.js +1 -2
- package/es/components/organism/LeftMenu/components/common/ChildMenu/index.d.ts +0 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +1 -2
- package/es/components/organism/LeftMenu/components/index.d.ts +1 -7
- package/es/components/organism/LeftMenu/components/index.js +1 -7
- package/es/components/organism/LeftMenu/constants/variables.d.ts +7 -0
- package/es/components/organism/LeftMenu/constants/variables.js +7 -0
- package/es/components/organism/LeftMenu/hooks/useLeftMenu.js +1 -1
- package/es/components/organism/LeftMenu/index.js +3 -24
- package/es/components/organism/LeftMenu/styled.d.ts +1 -1
- package/es/components/organism/LeftMenu/styled.js +12 -12
- package/es/components/organism/LeftMenu/utils/index.js +35 -12
- package/package.json +2 -2
- package/es/components/organism/LeftMenu/components/ContentMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/ContentMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/ContentMenu/useContentMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/ContentMenu/useContentMenu.js +0 -14
- package/es/components/organism/LeftMenu/components/DataMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/DataMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/DataMenu/useDataMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/DataMenu/useDataMenu.js +0 -12
- package/es/components/organism/LeftMenu/components/InsightsMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/InsightsMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/InsightsMenu/useInsightsMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/MarketingMenu/constants.d.ts +0 -7
- package/es/components/organism/LeftMenu/components/MarketingMenu/constants.js +0 -4
- package/es/components/organism/LeftMenu/components/MarketingMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/MarketingMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/MarketingMenu/useMarketingMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/MarketingMenu/useMarketingMenu.js +0 -14
- package/es/components/organism/LeftMenu/components/ProfilesMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/ProfilesMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/ProfilesMenu/useProfilesMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/ProfilesMenu/useProfilesMenu.js +0 -14
- package/es/components/organism/LeftMenu/components/SettingsMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/SettingsMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/SettingsMenu/useSettingsMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/SettingsMenu/useSettingsMenu.js +0 -12
- package/es/components/organism/LeftMenu/components/TemplatesMenu/index.d.ts +0 -2
- package/es/components/organism/LeftMenu/components/TemplatesMenu/index.js +0 -12
- package/es/components/organism/LeftMenu/components/TemplatesMenu/useTemplatesMenu.d.ts +0 -3
- package/es/components/organism/LeftMenu/components/TemplatesMenu/useTemplatesMenu.js +0 -14
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
//
|
|
4
|
-
import {
|
|
2
|
+
import React, { memo, useMemo } from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { ChildMenu } from '../common';
|
|
5
5
|
// Stores
|
|
6
6
|
import { useLeftMenuStore } from '../../stores';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Utils
|
|
8
|
+
import { getMenuItem } from '../../utils';
|
|
9
|
+
export const CommonMenu = memo(() => {
|
|
9
10
|
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
10
11
|
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(item)), [appMenuChildren]);
|
|
11
|
-
return {
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
};
|
|
12
|
+
return React.createElement(ChildMenu, { items: customChildren });
|
|
13
|
+
});
|
|
@@ -5,7 +5,6 @@ import { ChildMenu } from '../common';
|
|
|
5
5
|
import { Flex } from '../../../../atoms';
|
|
6
6
|
// Constants
|
|
7
7
|
import Icon from '@antscorp/icons';
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
8
|
// Styled
|
|
10
9
|
import { CreateButton, HomeMenuWrapper } from './styled';
|
|
11
10
|
// Hooks
|
|
@@ -19,5 +18,5 @@ export const HomeMenu = memo(() => {
|
|
|
19
18
|
React.createElement(Icon, { type: "icon-ants-plus-slim", style: { fontSize: 14 } }),
|
|
20
19
|
React.createElement("span", null, "Create"))),
|
|
21
20
|
React.createElement("div", { className: "menu-list" },
|
|
22
|
-
React.createElement(ChildMenu, { items: children,
|
|
21
|
+
React.createElement(ChildMenu, { items: children, onMenuClick: onMenuClick }))));
|
|
23
22
|
});
|
|
@@ -20,7 +20,7 @@ import { recursiveFindParentOfActiveItem } from './utils';
|
|
|
20
20
|
import { useLeftMenuStore } from '../../../stores';
|
|
21
21
|
import { useNavigatePath } from '../../../hooks';
|
|
22
22
|
export const ChildMenu = memo(props => {
|
|
23
|
-
const { items = [],
|
|
23
|
+
const { items = [], onMenuClick } = props;
|
|
24
24
|
// Stores
|
|
25
25
|
const auth = useLeftMenuStore(store => { var _a; return (_a = store.state.appConfig) === null || _a === void 0 ? void 0 : _a.auth; });
|
|
26
26
|
const activeAppCode = useLeftMenuStore(store => store.state.activeAppCode);
|
|
@@ -76,7 +76,6 @@ export const ChildMenu = memo(props => {
|
|
|
76
76
|
hash,
|
|
77
77
|
items,
|
|
78
78
|
pathname,
|
|
79
|
-
parentKey,
|
|
80
79
|
activeAppCode,
|
|
81
80
|
menuItems,
|
|
82
81
|
setLeftMenuState,
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
export { HomeMenu } from './HomeMenu';
|
|
2
|
-
export { ProfilesMenu } from './ProfilesMenu';
|
|
3
|
-
export { ContentMenu } from './ContentMenu';
|
|
4
|
-
export { DataMenu } from './DataMenu';
|
|
5
|
-
export { MarketingMenu } from './MarketingMenu';
|
|
6
|
-
export { InsightsMenu } from './InsightsMenu';
|
|
7
|
-
export { TemplatesMenu } from './TemplatesMenu';
|
|
8
|
-
export { SettingsMenu } from './SettingsMenu';
|
|
9
2
|
export { CustomMenu } from './CustomMenu';
|
|
3
|
+
export { CommonMenu } from './CommonMenu';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
export { HomeMenu } from './HomeMenu';
|
|
2
|
-
export { ProfilesMenu } from './ProfilesMenu';
|
|
3
|
-
export { ContentMenu } from './ContentMenu';
|
|
4
|
-
export { DataMenu } from './DataMenu';
|
|
5
|
-
export { MarketingMenu } from './MarketingMenu';
|
|
6
|
-
export { InsightsMenu } from './InsightsMenu';
|
|
7
|
-
export { TemplatesMenu } from './TemplatesMenu';
|
|
8
|
-
export { SettingsMenu } from './SettingsMenu';
|
|
9
2
|
export { CustomMenu } from './CustomMenu';
|
|
3
|
+
export { CommonMenu } from './CommonMenu';
|
|
@@ -31,3 +31,10 @@ export declare const MARKETING_CHANNEL_KEY: {
|
|
|
31
31
|
export declare const RENDER_OPTION: {
|
|
32
32
|
readonly CHANNEL: "destination_channel";
|
|
33
33
|
};
|
|
34
|
+
/** SETTING APP */
|
|
35
|
+
export declare const SETTING_APP: {
|
|
36
|
+
CHANNEL_INTEGRATION: {
|
|
37
|
+
code: string;
|
|
38
|
+
path: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -44,3 +44,10 @@ export const MARKETING_ROUTES = {
|
|
|
44
44
|
};
|
|
45
45
|
export const MARKETING_CHANNEL_KEY = { ALL_CHANNEL: 0, JOURNEY_ORCHESTRATION: 8 };
|
|
46
46
|
export const RENDER_OPTION = { CHANNEL: 'destination_channel' };
|
|
47
|
+
/** SETTING APP */
|
|
48
|
+
export const SETTING_APP = {
|
|
49
|
+
CHANNEL_INTEGRATION: {
|
|
50
|
+
code: 'CHANNEL_INTEGRATION',
|
|
51
|
+
path: '/gen2/:networkId/:user_id/marketing-hub/destinations/:channelId',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -12,7 +12,7 @@ import { ChildMenuWrapper, ExpandWrapper, FeatureMenu, FeatureMenuItem, LeftMenu
|
|
|
12
12
|
// Constants
|
|
13
13
|
import { APP_KEYS } from './constants';
|
|
14
14
|
// Components
|
|
15
|
-
import {
|
|
15
|
+
import { CustomMenu, CommonMenu, HomeMenu } from './components';
|
|
16
16
|
// Hooks
|
|
17
17
|
import { useLeftMenu, useNavigatePath } from './hooks';
|
|
18
18
|
export const LeftMenu = memo(props => {
|
|
@@ -40,31 +40,10 @@ export const LeftMenu = memo(props => {
|
|
|
40
40
|
case APP_KEYS.HOME: {
|
|
41
41
|
return React.createElement(HomeMenu, null);
|
|
42
42
|
}
|
|
43
|
-
case APP_KEYS.PROFILES: {
|
|
44
|
-
return React.createElement(ProfilesMenu, null);
|
|
45
|
-
}
|
|
46
|
-
case APP_KEYS.CONTENT: {
|
|
47
|
-
return React.createElement(ContentMenu, null);
|
|
48
|
-
}
|
|
49
|
-
case APP_KEYS.DATA: {
|
|
50
|
-
return React.createElement(DataMenu, null);
|
|
51
|
-
}
|
|
52
|
-
case APP_KEYS.MARKETING: {
|
|
53
|
-
return React.createElement(MarketingMenu, null);
|
|
54
|
-
}
|
|
55
|
-
case APP_KEYS.INSIGHTS: {
|
|
56
|
-
return React.createElement(InsightsMenu, null);
|
|
57
|
-
}
|
|
58
|
-
case APP_KEYS.TEMPLATES: {
|
|
59
|
-
return React.createElement(TemplatesMenu, null);
|
|
60
|
-
}
|
|
61
|
-
case APP_KEYS.SETTINGS: {
|
|
62
|
-
return React.createElement(SettingsMenu, null);
|
|
63
|
-
}
|
|
64
43
|
default:
|
|
65
|
-
return null;
|
|
44
|
+
return React.createElement(CommonMenu, null);
|
|
66
45
|
}
|
|
67
|
-
}, [activeAppCode, isCustomized,
|
|
46
|
+
}, [activeAppCode, isCustomized, state.hoverItem, onMenuItemClick]);
|
|
68
47
|
// Render components
|
|
69
48
|
const renderFeatureMenuItems = useCallback((item) => {
|
|
70
49
|
const { menu_item_name, menu_item, icon_name, menu_item_code, menu_item_path, menu_item_domain, } = item;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const PopoverWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
4
|
export declare const FeatureMenuWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {
|
|
4
5
|
isExpandMenu: boolean;
|
|
@@ -12,4 +13,3 @@ export declare const FeatureMenuItem: import("styled-components").StyledComponen
|
|
|
12
13
|
export declare const ChildMenuWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
13
14
|
isExpand: boolean;
|
|
14
15
|
}, never>;
|
|
15
|
-
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -7,6 +7,17 @@ import { HEADER_HEIGHT } from '../../molecules/HeaderV2/constants';
|
|
|
7
7
|
import { ICON_SIZE } from './constants';
|
|
8
8
|
// Components
|
|
9
9
|
import { Flex } from '../../atoms';
|
|
10
|
+
export const IconWrapper = styled.div `
|
|
11
|
+
width: 30px;
|
|
12
|
+
height: 30px;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
i {
|
|
18
|
+
font-size: ${ICON_SIZE}px;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
10
21
|
export const PopoverWrapper = styled.div `
|
|
11
22
|
opacity: 0;
|
|
12
23
|
visibility: hidden;
|
|
@@ -137,7 +148,7 @@ export const FeatureMenuItem = styled.div `
|
|
|
137
148
|
|
|
138
149
|
&.isHover,
|
|
139
150
|
&.isActive {
|
|
140
|
-
|
|
151
|
+
${IconWrapper},
|
|
141
152
|
span {
|
|
142
153
|
color: #005eb8;
|
|
143
154
|
}
|
|
@@ -182,14 +193,3 @@ export const ChildMenuWrapper = styled.div `
|
|
|
182
193
|
box-sizing: border-box;
|
|
183
194
|
z-index: 1;
|
|
184
195
|
`;
|
|
185
|
-
export const IconWrapper = styled.div `
|
|
186
|
-
width: 30px;
|
|
187
|
-
height: 30px;
|
|
188
|
-
display: flex;
|
|
189
|
-
justify-content: center;
|
|
190
|
-
align-items: center;
|
|
191
|
-
|
|
192
|
-
i {
|
|
193
|
-
font-size: ${ICON_SIZE}px;
|
|
194
|
-
}
|
|
195
|
-
`;
|
|
@@ -10,10 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
// Libraries
|
|
13
|
-
import { isArray, isEmpty, sortBy } from 'lodash';
|
|
13
|
+
import { cloneDeep, isArray, isEmpty, sortBy } from 'lodash';
|
|
14
14
|
import { generatePath } from 'react-router-dom';
|
|
15
15
|
// Constants
|
|
16
|
-
import { APP_KEYS, MARKETING_CHANNEL_KEY, HOME_MENU_ITEMS, MARKETING_ROUTES, MENU_ITEM_TYPE, RENDER_OPTION, HOME_REPORT_ROUTES, } from '../constants';
|
|
16
|
+
import { APP_KEYS, MARKETING_CHANNEL_KEY, HOME_MENU_ITEMS, MARKETING_ROUTES, MENU_ITEM_TYPE, RENDER_OPTION, HOME_REPORT_ROUTES, SETTING_APP, } from '../constants';
|
|
17
17
|
import { MARKETING_CHANNEL_CODE } from '../../../template/Layout/constants';
|
|
18
18
|
// Utils
|
|
19
19
|
import { handleError } from '@antscorp/antsomi-ui/es/utils';
|
|
@@ -109,6 +109,38 @@ export const recursiveGetInitialFeatureMenuItem = (featureMenuItem) => (Object.a
|
|
|
109
109
|
/** Map children to each App Item */
|
|
110
110
|
export const getMappingAppChildren = (args) => {
|
|
111
111
|
const { menuList, dashboardData, auth, destinationChannelEntries } = args;
|
|
112
|
+
const recursiveAddRenderOption = (menuItem) => {
|
|
113
|
+
var _a;
|
|
114
|
+
const cloneMenuItem = cloneDeep(menuItem);
|
|
115
|
+
switch (cloneMenuItem === null || cloneMenuItem === void 0 ? void 0 : cloneMenuItem.render_option) {
|
|
116
|
+
case RENDER_OPTION.CHANNEL: {
|
|
117
|
+
const path = (() => {
|
|
118
|
+
switch (menuItem.menu_item_code) {
|
|
119
|
+
case MARKETING_CHANNEL_CODE.CAMPAIGN:
|
|
120
|
+
return MARKETING_ROUTES.CHANNEL;
|
|
121
|
+
case SETTING_APP.CHANNEL_INTEGRATION.code:
|
|
122
|
+
return SETTING_APP.CHANNEL_INTEGRATION.path;
|
|
123
|
+
default:
|
|
124
|
+
return '';
|
|
125
|
+
}
|
|
126
|
+
})();
|
|
127
|
+
cloneMenuItem.children =
|
|
128
|
+
(destinationChannelEntries === null || destinationChannelEntries === void 0 ? void 0 : destinationChannelEntries.map(item => (Object.assign({}, getInitialFeatureMenuItem({
|
|
129
|
+
menu_item_code: item.channelCode,
|
|
130
|
+
menu_item_name: item.translateLabel,
|
|
131
|
+
logo_url: item.logoUrl,
|
|
132
|
+
menu_item_path: getGeneratePath(path, Object.assign(Object.assign({}, auth), { channelId: item.channelId })),
|
|
133
|
+
}))))) || [];
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
default:
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
if (cloneMenuItem === null || cloneMenuItem === void 0 ? void 0 : cloneMenuItem.children) {
|
|
140
|
+
cloneMenuItem.children = (_a = cloneMenuItem.children) === null || _a === void 0 ? void 0 : _a.map(item => recursiveAddRenderOption(item));
|
|
141
|
+
}
|
|
142
|
+
return cloneMenuItem;
|
|
143
|
+
};
|
|
112
144
|
return menuList === null || menuList === void 0 ? void 0 : menuList.map(appItem => {
|
|
113
145
|
var _a, _b, _c, _d;
|
|
114
146
|
switch (appItem.menu_item_code) {
|
|
@@ -135,7 +167,6 @@ export const getMappingAppChildren = (args) => {
|
|
|
135
167
|
}
|
|
136
168
|
case APP_KEYS.MARKETING: {
|
|
137
169
|
appItem.children = (_d = appItem.children) === null || _d === void 0 ? void 0 : _d.map(childMenuItem => {
|
|
138
|
-
var _a;
|
|
139
170
|
switch (childMenuItem.menu_item_code) {
|
|
140
171
|
case MARKETING_CHANNEL_CODE.ALL_CHANNEL:
|
|
141
172
|
childMenuItem.menu_item_path = getGeneratePath(MARKETING_ROUTES.CHANNEL, Object.assign(Object.assign({}, auth), { channelId: MARKETING_CHANNEL_KEY.ALL_CHANNEL }));
|
|
@@ -146,15 +177,6 @@ export const getMappingAppChildren = (args) => {
|
|
|
146
177
|
default:
|
|
147
178
|
break;
|
|
148
179
|
}
|
|
149
|
-
if ((childMenuItem === null || childMenuItem === void 0 ? void 0 : childMenuItem.render_option) === RENDER_OPTION.CHANNEL) {
|
|
150
|
-
childMenuItem.children =
|
|
151
|
-
((_a = destinationChannelEntries === null || destinationChannelEntries === void 0 ? void 0 : destinationChannelEntries.filter(item => item.channelId !== MARKETING_CHANNEL_KEY.JOURNEY_ORCHESTRATION)) === null || _a === void 0 ? void 0 : _a.map(item => (Object.assign({}, getInitialFeatureMenuItem({
|
|
152
|
-
menu_item_code: item.channelCode,
|
|
153
|
-
menu_item_name: item.translateLabel,
|
|
154
|
-
logo_url: item.logoUrl,
|
|
155
|
-
menu_item_path: getGeneratePath(MARKETING_ROUTES.CHANNEL, Object.assign(Object.assign({}, auth), { channelId: item.channelId })),
|
|
156
|
-
}))))) || [];
|
|
157
|
-
}
|
|
158
180
|
return childMenuItem;
|
|
159
181
|
});
|
|
160
182
|
break;
|
|
@@ -162,6 +184,7 @@ export const getMappingAppChildren = (args) => {
|
|
|
162
184
|
default:
|
|
163
185
|
break;
|
|
164
186
|
}
|
|
187
|
+
appItem = recursiveAddRenderOption(appItem);
|
|
165
188
|
return appItem;
|
|
166
189
|
});
|
|
167
190
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.5-beta.
|
|
3
|
+
"version": "1.3.5-beta.261",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"not op_mini all"
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@antscorp/icons": "^0.27.
|
|
63
|
+
"@antscorp/icons": "^0.27.23",
|
|
64
64
|
"@antscorp/image-editor": "1.0.2",
|
|
65
65
|
"@antscorp/processing-notification": "^1.0.3",
|
|
66
66
|
"@emotion/react": "^11.11.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Hooks
|
|
6
|
-
import { useContentMenu } from './useContentMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const ContentMenu = memo(() => {
|
|
10
|
-
const { children } = useContentMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.CONTENT });
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
// Utils
|
|
4
|
-
import { getMenuItem } from '../../utils';
|
|
5
|
-
// Stores
|
|
6
|
-
import { useLeftMenuStore } from '../../stores';
|
|
7
|
-
export const useContentMenu = () => {
|
|
8
|
-
// Selectors
|
|
9
|
-
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
10
|
-
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(item)), [appMenuChildren]);
|
|
11
|
-
return {
|
|
12
|
-
children: customChildren,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Hooks
|
|
6
|
-
import { useDataMenu } from './useDataMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const DataMenu = memo(() => {
|
|
10
|
-
const { children } = useDataMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.DATA });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
// Utils
|
|
4
|
-
import { getMenuItem } from '../../utils';
|
|
5
|
-
// Stores
|
|
6
|
-
import { useLeftMenuStore } from '../../stores';
|
|
7
|
-
export const useDataMenu = () => {
|
|
8
|
-
// Selectors
|
|
9
|
-
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
10
|
-
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(item)), [appMenuChildren]);
|
|
11
|
-
return { children: customChildren };
|
|
12
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Contexts
|
|
6
|
-
import { useInsightsMenu } from './useInsightsMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const InsightsMenu = memo(() => {
|
|
10
|
-
const { children } = useInsightsMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.INSIGHTS });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Hooks
|
|
6
|
-
import { useMarketingMenu } from './useMarketingMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const MarketingMenu = memo(() => {
|
|
10
|
-
const { children } = useMarketingMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.MARKETING });
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { isEmpty } from 'lodash';
|
|
4
|
-
// Utils
|
|
5
|
-
import { getMenuItem } from '../../utils';
|
|
6
|
-
// Constants
|
|
7
|
-
import { useLeftMenuStore } from '../../stores';
|
|
8
|
-
export const useMarketingMenu = () => {
|
|
9
|
-
// Selectors
|
|
10
|
-
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
11
|
-
// Memos
|
|
12
|
-
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(Object.assign(Object.assign({}, item), (isEmpty(item.children) ? {} : { children: item.children })))), [appMenuChildren]);
|
|
13
|
-
return { children: customChildren };
|
|
14
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Hooks
|
|
6
|
-
import { useProfilesMenu } from './useProfilesMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const ProfilesMenu = memo(() => {
|
|
10
|
-
const { children } = useProfilesMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.PROFILES });
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
// Utils
|
|
4
|
-
import { getMenuItem } from '../../utils';
|
|
5
|
-
// Stores
|
|
6
|
-
import { useLeftMenuStore } from '../../stores';
|
|
7
|
-
export const useProfilesMenu = () => {
|
|
8
|
-
// Selectors
|
|
9
|
-
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
10
|
-
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(item)), [appMenuChildren]);
|
|
11
|
-
return {
|
|
12
|
-
children: customChildren,
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Hooks
|
|
6
|
-
import { useSettingsMenu } from './useSettingsMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const SettingsMenu = memo(() => {
|
|
10
|
-
const { children } = useSettingsMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.SETTINGS });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
// Utils
|
|
4
|
-
import { getMenuItem } from '../../utils';
|
|
5
|
-
// Stores
|
|
6
|
-
import { useLeftMenuStore } from '../../stores';
|
|
7
|
-
export const useSettingsMenu = () => {
|
|
8
|
-
// Selectors
|
|
9
|
-
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
10
|
-
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(item)), [appMenuChildren]);
|
|
11
|
-
return { children: customChildren };
|
|
12
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import React, { memo } from 'react';
|
|
3
|
-
// Components
|
|
4
|
-
import { ChildMenu } from '../common';
|
|
5
|
-
// Hooks
|
|
6
|
-
import { useTemplatesMenu } from './useTemplatesMenu';
|
|
7
|
-
// Constants
|
|
8
|
-
import { APP_KEYS } from '../../constants';
|
|
9
|
-
export const TemplatesMenu = memo(() => {
|
|
10
|
-
const { children } = useTemplatesMenu();
|
|
11
|
-
return React.createElement(ChildMenu, { items: children, parentKey: APP_KEYS.TEMPLATES });
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
// Utils
|
|
4
|
-
import { getMenuItem } from '../../utils';
|
|
5
|
-
// Stores
|
|
6
|
-
import { useLeftMenuStore } from '../../stores';
|
|
7
|
-
export const useTemplatesMenu = () => {
|
|
8
|
-
// Selectors
|
|
9
|
-
const appMenuChildren = useLeftMenuStore(store => store.state.appMenuChildren);
|
|
10
|
-
const customChildren = useMemo(() => appMenuChildren === null || appMenuChildren === void 0 ? void 0 : appMenuChildren.map(item => getMenuItem(item)), [appMenuChildren]);
|
|
11
|
-
return {
|
|
12
|
-
children: customChildren,
|
|
13
|
-
};
|
|
14
|
-
};
|