hi-tm 0.4.9 → 0.5.1
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,85 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HeaderLayoutProps } from "../../../types/Layout/Headers/HeaderLayout";
|
|
3
|
-
/**
|
|
4
|
-
* The component accepts the following props:
|
|
5
|
-
* @param branchName - User's branch name to use in the logo URL.
|
|
6
|
-
* @param brandNameText - The name of the brand to display in the header.(next to the logo image)
|
|
7
|
-
* @param userFirstName - The first name of the user to display in the profile section.
|
|
8
|
-
* @param userLastName - The last name of the user to display in the profile section.
|
|
9
|
-
* @param logOutText - Logout text to display in the modal.
|
|
10
|
-
* @param logOutHandler - Function to handle the logout action when the user clicks the logout button.
|
|
11
|
-
* @param modalData - Array of modal data items to display in the profile dropdown menu.
|
|
12
|
-
* @type
|
|
13
|
-
* ```typescript
|
|
14
|
-
* {
|
|
15
|
-
* id: number;
|
|
16
|
-
* title: string;
|
|
17
|
-
* link: string;
|
|
18
|
-
* iconSrc: string;
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
* @param modalItemOnClickHandler - Function Called when the item is clicked.
|
|
22
|
-
* ```typescript
|
|
23
|
-
* {
|
|
24
|
-
* id: number;
|
|
25
|
-
* title: string;
|
|
26
|
-
* link: string;
|
|
27
|
-
* iconSrc: string;
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param iconsSRC - Object containing paths to various icon sources used in the header.
|
|
32
|
-
* ```typescript
|
|
33
|
-
* {
|
|
34
|
-
logoSRC: string,
|
|
35
|
-
iconProfileUserSRC: string,
|
|
36
|
-
logOutIconSRC: string,
|
|
37
|
-
arrowSRC: string,
|
|
38
|
-
refreshIconSRC: string,
|
|
39
|
-
notificationIconSRC: string,
|
|
40
|
-
languageIconSRC: string,
|
|
41
|
-
menuIconSRC: string,
|
|
42
|
-
trashIconSRC: string,
|
|
43
|
-
closeIconSRC: string,
|
|
44
|
-
}
|
|
45
|
-
* ```
|
|
46
|
-
* @param cdnURL - The base URL for CDN resources.
|
|
47
|
-
* @param userBranchesData - Array of user branch data for branch selection.
|
|
48
|
-
* @param selectBranchHandler - Function to handle branch selection ( Void OR It returns the following type).
|
|
49
|
-
* @type
|
|
50
|
-
* ```typescript
|
|
51
|
-
* {
|
|
52
|
-
* id: number;
|
|
53
|
-
* name: string;
|
|
54
|
-
* urlName: string;
|
|
55
|
-
* imageName: string;
|
|
56
|
-
* logoName: string;
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
* @param sidebarData - Array of sidebar data for search in header.
|
|
60
|
-
* @type
|
|
61
|
-
* ```typescript
|
|
62
|
-
* {
|
|
63
|
-
* id: number;
|
|
64
|
-
* imgSrc: string;
|
|
65
|
-
* name: string;
|
|
66
|
-
* keyNameLang: string;
|
|
67
|
-
* FirstSubsets?: FirstSubset[];
|
|
68
|
-
* }
|
|
69
|
-
* ```
|
|
70
|
-
* @param searchIconSRC - The path to the search icon source => type:string.
|
|
71
|
-
* @param searchItemHandler - When the user searches for an item and clicks on a search result,
|
|
72
|
-
* the clicked item is returned with the following type:
|
|
73
|
-
* ```typescript
|
|
74
|
-
* {
|
|
75
|
-
* id: number;
|
|
76
|
-
* name: string;
|
|
77
|
-
* routeURL: string;
|
|
78
|
-
* iconSRC: string;
|
|
79
|
-
* keyNameLang: string;
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
* @param refreshPageHandler - Function to refresh the page when the refresh icon is clicked.
|
|
83
|
-
*/
|
|
84
3
|
declare const HeaderLayout: React.FC<HeaderLayoutProps>;
|
|
85
4
|
export default HeaderLayout;
|
|
@@ -42,87 +42,6 @@ const link_1 = __importDefault(require("next/link"));
|
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const ModalProvider_1 = __importDefault(require("../../sections/components/Modals/ModalProvider"));
|
|
44
44
|
const ModalSearchContentInHeader_1 = __importDefault(require("../../sections/components/Modals/ModalSearchContentInHeader"));
|
|
45
|
-
/**
|
|
46
|
-
* The component accepts the following props:
|
|
47
|
-
* @param branchName - User's branch name to use in the logo URL.
|
|
48
|
-
* @param brandNameText - The name of the brand to display in the header.(next to the logo image)
|
|
49
|
-
* @param userFirstName - The first name of the user to display in the profile section.
|
|
50
|
-
* @param userLastName - The last name of the user to display in the profile section.
|
|
51
|
-
* @param logOutText - Logout text to display in the modal.
|
|
52
|
-
* @param logOutHandler - Function to handle the logout action when the user clicks the logout button.
|
|
53
|
-
* @param modalData - Array of modal data items to display in the profile dropdown menu.
|
|
54
|
-
* @type
|
|
55
|
-
* ```typescript
|
|
56
|
-
* {
|
|
57
|
-
* id: number;
|
|
58
|
-
* title: string;
|
|
59
|
-
* link: string;
|
|
60
|
-
* iconSrc: string;
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
* @param modalItemOnClickHandler - Function Called when the item is clicked.
|
|
64
|
-
* ```typescript
|
|
65
|
-
* {
|
|
66
|
-
* id: number;
|
|
67
|
-
* title: string;
|
|
68
|
-
* link: string;
|
|
69
|
-
* iconSrc: string;
|
|
70
|
-
* }
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* @param iconsSRC - Object containing paths to various icon sources used in the header.
|
|
74
|
-
* ```typescript
|
|
75
|
-
* {
|
|
76
|
-
logoSRC: string,
|
|
77
|
-
iconProfileUserSRC: string,
|
|
78
|
-
logOutIconSRC: string,
|
|
79
|
-
arrowSRC: string,
|
|
80
|
-
refreshIconSRC: string,
|
|
81
|
-
notificationIconSRC: string,
|
|
82
|
-
languageIconSRC: string,
|
|
83
|
-
menuIconSRC: string,
|
|
84
|
-
trashIconSRC: string,
|
|
85
|
-
closeIconSRC: string,
|
|
86
|
-
}
|
|
87
|
-
* ```
|
|
88
|
-
* @param cdnURL - The base URL for CDN resources.
|
|
89
|
-
* @param userBranchesData - Array of user branch data for branch selection.
|
|
90
|
-
* @param selectBranchHandler - Function to handle branch selection ( Void OR It returns the following type).
|
|
91
|
-
* @type
|
|
92
|
-
* ```typescript
|
|
93
|
-
* {
|
|
94
|
-
* id: number;
|
|
95
|
-
* name: string;
|
|
96
|
-
* urlName: string;
|
|
97
|
-
* imageName: string;
|
|
98
|
-
* logoName: string;
|
|
99
|
-
* }
|
|
100
|
-
* ```
|
|
101
|
-
* @param sidebarData - Array of sidebar data for search in header.
|
|
102
|
-
* @type
|
|
103
|
-
* ```typescript
|
|
104
|
-
* {
|
|
105
|
-
* id: number;
|
|
106
|
-
* imgSrc: string;
|
|
107
|
-
* name: string;
|
|
108
|
-
* keyNameLang: string;
|
|
109
|
-
* FirstSubsets?: FirstSubset[];
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
* @param searchIconSRC - The path to the search icon source => type:string.
|
|
113
|
-
* @param searchItemHandler - When the user searches for an item and clicks on a search result,
|
|
114
|
-
* the clicked item is returned with the following type:
|
|
115
|
-
* ```typescript
|
|
116
|
-
* {
|
|
117
|
-
* id: number;
|
|
118
|
-
* name: string;
|
|
119
|
-
* routeURL: string;
|
|
120
|
-
* iconSRC: string;
|
|
121
|
-
* keyNameLang: string;
|
|
122
|
-
* }
|
|
123
|
-
* ```
|
|
124
|
-
* @param refreshPageHandler - Function to refresh the page when the refresh icon is clicked.
|
|
125
|
-
*/
|
|
126
45
|
const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, userLastName, logOutText, logOutHandler, modalData, modalItemOnClickHandler, iconsSRC, cdnURL, userBranchesData, selectBranchHandler, sidebarData, searchIconSRC, searchItemHandler, refreshPageHandler, brandNameText, languages, changeLanguageHandler, onLogoClickHandler, defaultLogoImage, }) => {
|
|
127
46
|
const [isShowModalSearch, setIsShowModalSearch] = (0, react_1.useState)(false);
|
|
128
47
|
const [isOpenModal, setIsOpenModal] = (0, react_1.useState)(false);
|
|
@@ -132,7 +51,6 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
132
51
|
id: 0,
|
|
133
52
|
name: "",
|
|
134
53
|
urlName: "",
|
|
135
|
-
imageName: "",
|
|
136
54
|
logoName: "",
|
|
137
55
|
});
|
|
138
56
|
const modalCloseRefPC = (0, react_1.useRef)(null);
|
|
@@ -145,7 +63,7 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
145
63
|
setIsOpenModal(!isOpenModal);
|
|
146
64
|
};
|
|
147
65
|
const handleModalShowBranches = () => {
|
|
148
|
-
if (userBranchesData
|
|
66
|
+
if (userBranchesData && userBranchesData.length > 1) {
|
|
149
67
|
setIsOpenModalBranches(!isOpenModalBranches);
|
|
150
68
|
}
|
|
151
69
|
};
|
|
@@ -153,22 +71,19 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
153
71
|
setIsOpenLanguageModal(!isOpenLanguageModal);
|
|
154
72
|
};
|
|
155
73
|
(0, react_1.useEffect)(() => {
|
|
156
|
-
if (userBranchesData
|
|
74
|
+
if (userBranchesData && userBranchesData.length > 0) {
|
|
157
75
|
setBranchNameSelected(userBranchesData[0]);
|
|
158
76
|
}
|
|
159
77
|
}, [userBranchesData]);
|
|
160
78
|
const selectItemBranchHandler = (branch) => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
setIsOpenModalBranches(false);
|
|
165
|
-
}
|
|
79
|
+
setBranchNameSelected(branch);
|
|
80
|
+
selectBranchHandler(branch);
|
|
81
|
+
setIsOpenModalBranches(false);
|
|
166
82
|
};
|
|
167
83
|
const selectLanguageHandler = (language) => {
|
|
168
84
|
changeLanguageHandler(language);
|
|
169
85
|
setIsOpenLanguageModal(false);
|
|
170
86
|
};
|
|
171
|
-
console.log("userBranchesData", userBranchesData);
|
|
172
87
|
(0, react_1.useEffect)(() => {
|
|
173
88
|
const handleClickOutside = (event) => {
|
|
174
89
|
if (modalCloseRefPC.current &&
|
|
@@ -222,18 +137,16 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
222
137
|
appVersion,
|
|
223
138
|
")"),
|
|
224
139
|
react_1.default.createElement("p", { className: "text-nowrap" }, brandNameText)),
|
|
225
|
-
react_1.default.createElement(image_1.default, { src: iconsSRC.logoSRC, alt: "logo", width: 40, height: 40, className: "select-none-custom h-10 w-10", onClick:
|
|
226
|
-
onLogoClickHandler();
|
|
227
|
-
} }))),
|
|
140
|
+
react_1.default.createElement(image_1.default, { src: iconsSRC.logoSRC, alt: "logo", width: 40, height: 40, className: "select-none-custom h-10 w-10", onClick: onLogoClickHandler }))),
|
|
228
141
|
react_1.default.createElement("div", { ref: modalCloseRefuserBranchesPC, className: `relative bg-inherit ${branchNameSelected?.id === 0 ? "hidden" : "flex"}` },
|
|
229
142
|
react_1.default.createElement("div", { onClick: handleModalShowBranches, className: "select-none-custom flex flex-row items-center justify-center gap-3" },
|
|
230
|
-
react_1.default.createElement(image_1.default, { src: `${baseUrlCDN}/${branchName}/${branchNameSelected.logoName}`, alt: "logo.svg", width: 24, height: 24, className: `rounded-md ${userBranchesData
|
|
143
|
+
react_1.default.createElement(image_1.default, { src: `${baseUrlCDN}/${branchName}/${branchNameSelected.logoName}`, alt: "logo.svg", width: 24, height: 24, className: `rounded-md ${userBranchesData && userBranchesData.length <= 1
|
|
231
144
|
? "cursor-default"
|
|
232
145
|
: "cursor-pointer"}` }),
|
|
233
|
-
react_1.default.createElement("p", { className: `${userBranchesData
|
|
146
|
+
react_1.default.createElement("p", { className: `${userBranchesData && userBranchesData.length <= 1
|
|
234
147
|
? "cursor-default"
|
|
235
148
|
: "cursor-pointer"}` }, branchNameSelected.name),
|
|
236
|
-
react_1.default.createElement(image_1.default, { src: iconsSRC.arrowSRC, alt: "arrow.svg", width: 16, height: 16, className: `customTransition ${userBranchesData
|
|
149
|
+
react_1.default.createElement(image_1.default, { src: iconsSRC.arrowSRC, alt: "arrow.svg", width: 16, height: 16, className: `customTransition ${userBranchesData && userBranchesData.length <= 1
|
|
237
150
|
? "hidden"
|
|
238
151
|
: isOpenModalBranches
|
|
239
152
|
? "flex rotate-180 cursor-pointer"
|
|
@@ -241,14 +154,13 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
241
154
|
react_1.default.createElement("div", { className: `customShadowBox customTransition absolute left-0 top-[30px] z-60 w-auto rounded-lg bg-white-color p-tiny ${isOpenModalBranches
|
|
242
155
|
? "scale-y-100 opacity-100"
|
|
243
156
|
: "scale-y-0 opacity-0"} origin-top` },
|
|
244
|
-
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-center gap-3 bg-inherit p-3" }, userBranchesData
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
react_1.default.createElement("p", { className: "select-none-custom cursor-pointer text-nowrap text-sm font-normal text-text-color-primary" }, item.name))))))),
|
|
157
|
+
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-center gap-3 bg-inherit p-3" }, userBranchesData?.map((item) => (react_1.default.createElement("li", { onClick: () => selectItemBranchHandler(item), key: item.id, className: "customTransition flex w-full flex-row items-center justify-end gap-2 rounded-tiny px-5 py-2 text-text-color-primary hover:bg-gray-primary" },
|
|
158
|
+
react_1.default.createElement(image_1.default, { src: item.logoName === " " ||
|
|
159
|
+
item.logoName === null ||
|
|
160
|
+
item.logoName === undefined
|
|
161
|
+
? defaultLogoImage
|
|
162
|
+
: `${baseUrlCDN}/${branchName}/${item.logoName}`, alt: "logo.svg", width: 16, height: 16, className: "rounded-xl" }),
|
|
163
|
+
react_1.default.createElement("p", { className: "select-none-custom cursor-pointer text-nowrap text-sm font-normal text-text-color-primary" }, item.name))))))),
|
|
252
164
|
react_1.default.createElement("div", { ref: modalCloseRefPC, className: "flex h-full flex-row-reverse items-center justify-center gap-4" },
|
|
253
165
|
react_1.default.createElement("div", { onClick: handleModalShow, className: "border-primaryBorderColor relative flex cursor-pointer flex-row items-center justify-center gap-1 rounded-lg border border-solid p-tiny" },
|
|
254
166
|
react_1.default.createElement("div", { className: "flex flex-row items-center justify-center gap-1" },
|
|
@@ -259,13 +171,12 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
259
171
|
react_1.default.createElement(image_1.default, { src: iconsSRC.arrowSRC, alt: "arrow-down.svg", width: 10, height: 10, className: `select-none-custom customTransition ${isOpenModal ? "rotate-180" : "rotate-0"}` })),
|
|
260
172
|
react_1.default.createElement("div", { className: `customShadowBox customTransition absolute left-2 top-[40px] z-60 w-[216px] rounded-lg bg-white-color p-tiny ${isOpenModal ? "scale-y-100 opacity-100" : "scale-y-0 opacity-0"} origin-top` },
|
|
261
173
|
react_1.default.createElement("ul", { className: "flex h-full w-full flex-col items-start justify-center gap-3 p-3" },
|
|
262
|
-
modalData
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
react_1.default.createElement(image_1.default, { src: item.iconSrc, alt: "user-square.svg", width: 16, height: 16 })))),
|
|
174
|
+
modalData?.map((item) => (react_1.default.createElement("li", { onClick: () => {
|
|
175
|
+
handleModalShow();
|
|
176
|
+
modalItemOnClickHandler(item);
|
|
177
|
+
}, key: item.id, className: "customTransition flex w-full flex-row-reverse items-center justify-end gap-1 rounded-xl p-2 text-text-color-primary hover:bg-gray-primary" },
|
|
178
|
+
react_1.default.createElement("p", null, item.title),
|
|
179
|
+
react_1.default.createElement(image_1.default, { src: item.iconSrc, alt: "user-square.svg", width: 16, height: 16 })))),
|
|
269
180
|
react_1.default.createElement("li", { onClick: () => {
|
|
270
181
|
logOutHandler();
|
|
271
182
|
handleModalShow();
|
|
@@ -273,9 +184,7 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
273
184
|
react_1.default.createElement("p", { className: "text-nowrap" }, logOutText),
|
|
274
185
|
react_1.default.createElement(image_1.default, { src: iconsSRC.logOutIconSRC, alt: "logOutIcon.svg", width: 16, height: 16 }))))),
|
|
275
186
|
react_1.default.createElement("div", { className: "flex flex-row items-center gap-2" },
|
|
276
|
-
react_1.default.createElement(image_1.default, { src: searchIconSRC, alt: "search.svg", width: 24, height: 24, className: "select-none-custom customTransition cursor-pointer hover:scale-105", onClick: () =>
|
|
277
|
-
setIsShowModalSearch(!isShowModalSearch);
|
|
278
|
-
} }),
|
|
187
|
+
react_1.default.createElement(image_1.default, { src: searchIconSRC, alt: "search.svg", width: 24, height: 24, className: "select-none-custom customTransition cursor-pointer hover:scale-105", onClick: () => setIsShowModalSearch(!isShowModalSearch) }),
|
|
279
188
|
react_1.default.createElement("button", { className: "customTransition hover:scale-105 cursor-pointer" },
|
|
280
189
|
react_1.default.createElement(image_1.default, { onClick: refreshPageHandler, src: iconsSRC.refreshIconSRC, alt: "refreshIcon", width: 22, height: 22, className: "customTransition h-5 w-5 cursor-pointer" })),
|
|
281
190
|
react_1.default.createElement(image_1.default, { src: iconsSRC.notificationIconSRC, alt: "notification.svg", width: 22, height: 22, className: "h-5 w-5 cursor-default opacity-50" }),
|
|
@@ -285,7 +194,7 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
285
194
|
react_1.default.createElement("div", { className: `customShadowBox customTransition absolute -right-[38px] top-[35px] z-[80000] w-fit rounded-lg bg-white-color p-tiny ${isOpenLanguageModal
|
|
286
195
|
? "scale-y-100 opacity-100"
|
|
287
196
|
: "scale-y-0 opacity-0"} origin-top` },
|
|
288
|
-
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-end gap-3 p-3" }, languages.map((language) => (react_1.default.createElement("li", { key: language
|
|
197
|
+
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-end gap-3 p-3" }, languages.map((language) => (react_1.default.createElement("li", { key: language.id, onClick: () => selectLanguageHandler(language), className: "customTransition flex w-full flex-row items-center justify-between gap-2 rounded-tiny px-5 py-2 text-text-color-primary hover:bg-gray-primary" },
|
|
289
198
|
react_1.default.createElement(image_1.default, { src: language.flagIcon, alt: `${language.showName}-flag`, width: 16, height: 16, className: "rounded-sm" }),
|
|
290
199
|
react_1.default.createElement("p", { className: "select-none-custom w-full cursor-pointer text-nowrap text-sm font-normal text-text-color-primary" }, language.showName)))))))))),
|
|
291
200
|
react_1.default.createElement("header", { style: { zIndex: 100 }, className: "flex h-11 w-full flex-row items-center justify-between bg-back-ground-color-primary px-5 xl:hidden fixed top-0 z-layout" },
|
|
@@ -293,31 +202,28 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
293
202
|
react_1.default.createElement(image_1.default, { src: iconsSRC.menuIconSRC, alt: "menu.svg", width: 20, height: 20, className: "h-full w-full" })),
|
|
294
203
|
react_1.default.createElement("div", { ref: modalCloseRefuserBranchesMobile, className: `relative bg-inherit ${branchNameSelected?.id === 0 ? "hidden" : "flex"}` },
|
|
295
204
|
react_1.default.createElement("div", { onClick: handleModalShowBranches, className: "select-none-custom flex flex-row items-center justify-center gap-3" },
|
|
296
|
-
react_1.default.createElement(image_1.default, { src: `${baseUrlCDN}/${branchName}/${branchNameSelected.logoName}`, alt: "logo.svg", width: 24, height: 24, className: `rounded-md ${userBranchesData
|
|
205
|
+
react_1.default.createElement(image_1.default, { src: `${baseUrlCDN}/${branchName}/${branchNameSelected.logoName}`, alt: "logo.svg", width: 24, height: 24, className: `rounded-md ${userBranchesData && userBranchesData.length <= 1
|
|
297
206
|
? "cursor-default"
|
|
298
207
|
: "cursor-pointer"}` }),
|
|
299
|
-
react_1.default.createElement("p", { className: `${userBranchesData
|
|
208
|
+
react_1.default.createElement("p", { className: `${userBranchesData && userBranchesData.length <= 1
|
|
300
209
|
? "cursor-default"
|
|
301
210
|
: "cursor-pointer"}` }, branchNameSelected.name),
|
|
302
|
-
react_1.default.createElement(image_1.default, { src: iconsSRC.arrowSRC, alt: "arrow.svg", width: 16, height: 16, className: `${userBranchesData
|
|
211
|
+
react_1.default.createElement(image_1.default, { src: iconsSRC.arrowSRC, alt: "arrow.svg", width: 16, height: 16, className: `${userBranchesData && userBranchesData.length <= 1
|
|
303
212
|
? "hidden"
|
|
304
213
|
: "flex cursor-pointer"}` })),
|
|
305
214
|
react_1.default.createElement("div", { className: `customShadowBox customTransition absolute left-0 top-[40px] z-60 w-auto rounded-lg bg-white-color p-tiny ${isOpenModalBranches
|
|
306
215
|
? "scale-y-100 opacity-100"
|
|
307
216
|
: "scale-y-0 opacity-0"} origin-top` },
|
|
308
|
-
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-center gap-3 bg-inherit p-3" }, userBranchesData
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
react_1.default.createElement("p", { className: "select-none-custom cursor-pointer text-nowrap text-sm font-normal text-text-color-primary" }, item.name))))))),
|
|
217
|
+
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-center gap-3 bg-inherit p-3" }, userBranchesData?.map((item) => (react_1.default.createElement("li", { onClick: () => selectItemBranchHandler(item), key: item.id, className: "customTransition flex w-full flex-row items-center justify-end gap-2 rounded-tiny px-5 py-2 text-text-color-primary hover:bg-gray-primary" },
|
|
218
|
+
react_1.default.createElement(image_1.default, { src: item.logoName === " " ||
|
|
219
|
+
item.logoName === null ||
|
|
220
|
+
item.logoName === undefined
|
|
221
|
+
? defaultLogoImage
|
|
222
|
+
: `${baseUrlCDN}/${branchName}/${item.logoName}`, alt: "logo.svg", width: 16, height: 16, className: "rounded-xl" }),
|
|
223
|
+
react_1.default.createElement("p", { className: "select-none-custom cursor-pointer text-nowrap text-sm font-normal text-text-color-primary" }, item.name))))))),
|
|
316
224
|
react_1.default.createElement("div", { ref: modalCloseRefMobile, className: "flex flex-row items-center justify-center gap-2" },
|
|
317
225
|
react_1.default.createElement("div", { className: "flex flex-row items-center justify-center gap-2" },
|
|
318
|
-
react_1.default.createElement(image_1.default, { src: searchIconSRC, alt: "search.svg", width: 24, height: 24, className: "select-none-custom customTransition cursor-pointer hover:scale-105", onClick: () =>
|
|
319
|
-
setIsShowModalSearch(!isShowModalSearch);
|
|
320
|
-
} }),
|
|
226
|
+
react_1.default.createElement(image_1.default, { src: searchIconSRC, alt: "search.svg", width: 24, height: 24, className: "select-none-custom customTransition cursor-pointer hover:scale-105", onClick: () => setIsShowModalSearch(!isShowModalSearch) }),
|
|
321
227
|
react_1.default.createElement(image_1.default, { src: iconsSRC.notificationIconSRC, alt: "notification.svg", width: 20, height: 20, className: "h-5 w-5 cursor-default opacity-50" })),
|
|
322
228
|
react_1.default.createElement("div", { ref: modalCloseRefLanguageMobile, className: "relative" },
|
|
323
229
|
react_1.default.createElement("div", { className: "customTransition mr-2 cursor-pointer hover:scale-125", onClick: handleLanguageModalShow },
|
|
@@ -325,21 +231,20 @@ const HeaderLayout = ({ appVersion, branchName, userFirstName, sidebarHandler, u
|
|
|
325
231
|
react_1.default.createElement("div", { className: `customShadowBox customTransition absolute -right-[29px] top-[40px] z-[80000] w-fit rounded-lg bg-white-color p-tiny ${isOpenLanguageModal
|
|
326
232
|
? "scale-y-100 opacity-100"
|
|
327
233
|
: "scale-y-0 opacity-0"} origin-top` },
|
|
328
|
-
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-center gap-3 p-3" }, languages.map((language) => (react_1.default.createElement("li", { key: language
|
|
234
|
+
react_1.default.createElement("ul", { className: "flex h-auto w-full flex-col items-start justify-center gap-3 p-3" }, languages.map((language) => (react_1.default.createElement("li", { key: language.id, onClick: () => selectLanguageHandler(language), className: "customTransition flex w-full flex-row items-center justify-between gap-2 rounded-tiny px-5 py-2 text-text-color-primary hover:bg-gray-primary" },
|
|
329
235
|
react_1.default.createElement(image_1.default, { src: language.flagIcon, alt: `${language.showName}-flag`, width: 16, height: 16, className: "rounded-sm" }),
|
|
330
236
|
react_1.default.createElement("p", { className: "select-none-custom w-full cursor-pointer text-nowrap text-sm font-normal text-text-color-primary" }, language.showName))))))),
|
|
331
237
|
react_1.default.createElement("div", { onClick: handleModalShow, className: "mr-2 flex h-8 w-10 cursor-pointer flex-row items-center justify-center rounded-lg border border-solid border-border-color-primary bg-inherit" },
|
|
332
238
|
react_1.default.createElement(image_1.default, { src: iconsSRC.iconProfileUserSRC, alt: "profile.svg", width: 18, height: 18 })),
|
|
333
239
|
react_1.default.createElement("div", { className: `customShadowBox customTransition absolute left-4 top-10 z-60 w-[182px] rounded-lg bg-white-color p-tiny ${isOpenModal ? "scale-y-100 opacity-100" : "scale-y-0 opacity-0"} origin-top` },
|
|
334
240
|
react_1.default.createElement("ul", { className: "flex h-full w-full flex-col items-start justify-center gap-3 p-3" },
|
|
335
|
-
modalData.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
react_1.default.createElement("
|
|
341
|
-
|
|
342
|
-
react_1.default.createElement(image_1.default, { src: item.iconSrc, alt: "user-square.svg", width: 16, height: 16 }))))),
|
|
241
|
+
modalData?.map((item) => (react_1.default.createElement("li", { onClick: () => {
|
|
242
|
+
handleModalShow();
|
|
243
|
+
modalItemOnClickHandler(item);
|
|
244
|
+
}, key: item.id, className: "w-full cursor-pointer text-xs" },
|
|
245
|
+
react_1.default.createElement("div", { className: "customTransition flex w-full flex-row-reverse items-center justify-end gap-1 rounded-xl p-2 text-text-color-primary hover:bg-gray-primary" },
|
|
246
|
+
react_1.default.createElement("p", { className: "text-xs text-nowrap" }, item.title),
|
|
247
|
+
react_1.default.createElement(image_1.default, { src: item.iconSrc, alt: "user-square.svg", width: 16, height: 16 }))))),
|
|
343
248
|
react_1.default.createElement("li", { onClick: () => {
|
|
344
249
|
logOutHandler();
|
|
345
250
|
handleModalShow();
|