icleafreportui 0.1.6 → 0.1.7
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/dist/App.js +39 -43
- package/dist/Login.js +130 -121
- package/dist/Reports/CourseReport.js +163 -152
- package/dist/Reports/ExamPackReport.js +245 -226
- package/dist/Reports/ExamReport.js +173 -161
- package/dist/Reports/Report.js +193 -178
- package/dist/api/client.js +1 -7
- package/dist/components/Header.js +76 -78
- package/dist/components/Loader.js +16 -22
- package/dist/components/imagePathUrl.js +5 -11
- package/dist/components/sidebar.js +96 -65
- package/dist/context/TenantProvider.js +13 -22
- package/dist/index.js +16 -15
- package/dist/package.js +15 -100
- package/dist/reportWebVitals.js +2 -10
- package/dist/setupTests.js +5 -3
- package/package.json +1 -1
package/dist/Reports/Report.js
CHANGED
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _reactRouterDom = require("react-router-dom");
|
|
10
|
-
var _Header = _interopRequireDefault(require("../components/Header"));
|
|
11
|
-
var _sidebar = _interopRequireDefault(require("../components/sidebar"));
|
|
12
|
-
var _TenantProvider = require("../context/TenantProvider");
|
|
13
|
-
require("../App.css");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // ADD THIS
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Autocomplete, FormControl, Button, Grid, Box, Typography, Paper, Snackbar, Alert, CircularProgress, TextField, Checkbox, FormControlLabel } from '@mui/material';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import Header from '../components/Header';
|
|
5
|
+
import Sidebar from '../components/sidebar';
|
|
6
|
+
import { useTenant } from '../context/TenantProvider'; // ADD THIS
|
|
7
|
+
import '../App.css';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
9
|
function Report() {
|
|
19
10
|
const {
|
|
20
11
|
apiClient
|
|
21
|
-
} =
|
|
22
|
-
const navigate =
|
|
23
|
-
const [subjects, setSubjects] =
|
|
24
|
-
const [examPacks, setExamPacks] =
|
|
25
|
-
const [exams, setExams] =
|
|
26
|
-
const [users, setUsers] =
|
|
27
|
-
const [selectedSubject, setSelectedSubject] =
|
|
28
|
-
const [selectedExamPack, setSelectedExamPack] =
|
|
29
|
-
const [selectedExam, setSelectedExam] =
|
|
30
|
-
const [selectedUser, setSelectedUser] =
|
|
31
|
-
const [alertMessage, setAlertMessage] =
|
|
32
|
-
const [openAlert, setOpenAlert] =
|
|
33
|
-
const [loading, setLoading] =
|
|
34
|
-
const [onlyWrongAnswers, setOnlyWrongAnswers] =
|
|
12
|
+
} = useTenant(); // ADD THIS - gets API client with token
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const [subjects, setSubjects] = useState([]);
|
|
15
|
+
const [examPacks, setExamPacks] = useState([]);
|
|
16
|
+
const [exams, setExams] = useState([]);
|
|
17
|
+
const [users, setUsers] = useState([]);
|
|
18
|
+
const [selectedSubject, setSelectedSubject] = useState(null);
|
|
19
|
+
const [selectedExamPack, setSelectedExamPack] = useState(null);
|
|
20
|
+
const [selectedExam, setSelectedExam] = useState(null);
|
|
21
|
+
const [selectedUser, setSelectedUser] = useState(null);
|
|
22
|
+
const [alertMessage, setAlertMessage] = useState('');
|
|
23
|
+
const [openAlert, setOpenAlert] = useState(false);
|
|
24
|
+
const [loading, setLoading] = useState(false);
|
|
25
|
+
const [onlyWrongAnswers, setOnlyWrongAnswers] = useState(false);
|
|
35
26
|
const baseURL = process.env.REACT_APP_BASE_URL;
|
|
36
|
-
|
|
27
|
+
useEffect(() => {
|
|
37
28
|
// REMOVE token check - no more JWT
|
|
38
29
|
fetchAllSubjects();
|
|
39
30
|
}, []);
|
|
@@ -150,150 +141,174 @@ function Report() {
|
|
|
150
141
|
setLoading(false);
|
|
151
142
|
}
|
|
152
143
|
};
|
|
153
|
-
return /*#__PURE__*/
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
144
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
145
|
+
children: [/*#__PURE__*/_jsx(Header, {}), /*#__PURE__*/_jsx(Sidebar, {}), /*#__PURE__*/_jsxs("div", {
|
|
146
|
+
style: {
|
|
147
|
+
padding: "100px 0px 0px 100px",
|
|
148
|
+
marginLeft: "140px"
|
|
149
|
+
},
|
|
150
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
151
|
+
sx: {
|
|
152
|
+
maxWidth: 800,
|
|
153
|
+
mx: 'auto',
|
|
154
|
+
my: 4,
|
|
155
|
+
p: 3,
|
|
156
|
+
backgroundColor: '#f5f5f5',
|
|
157
|
+
borderRadius: 2
|
|
158
|
+
},
|
|
159
|
+
children: /*#__PURE__*/_jsxs(Paper, {
|
|
160
|
+
elevation: 6,
|
|
161
|
+
sx: {
|
|
162
|
+
p: 5,
|
|
163
|
+
textAlign: 'center',
|
|
164
|
+
backgroundColor: '#fff'
|
|
165
|
+
},
|
|
166
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
167
|
+
variant: "h4",
|
|
168
|
+
component: "h1",
|
|
169
|
+
gutterBottom: true,
|
|
170
|
+
sx: {
|
|
171
|
+
color: '#3f51b5',
|
|
172
|
+
marginBottom: "20px"
|
|
173
|
+
},
|
|
174
|
+
children: "Exam Report"
|
|
175
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
|
176
|
+
container: true,
|
|
177
|
+
spacing: 2,
|
|
178
|
+
justifyContent: "center",
|
|
179
|
+
children: [/*#__PURE__*/_jsx(Grid, {
|
|
180
|
+
item: true,
|
|
181
|
+
xs: 12,
|
|
182
|
+
sm: 6,
|
|
183
|
+
children: /*#__PURE__*/_jsx(FormControl, {
|
|
184
|
+
fullWidth: true,
|
|
185
|
+
children: /*#__PURE__*/_jsx(Autocomplete, {
|
|
186
|
+
id: "ddlSubject",
|
|
187
|
+
options: subjects,
|
|
188
|
+
getOptionLabel: option => option.subjectName,
|
|
189
|
+
value: selectedSubject,
|
|
190
|
+
onChange: handleSubjectChange,
|
|
191
|
+
renderInput: params => /*#__PURE__*/_jsx(TextField, {
|
|
192
|
+
...params,
|
|
193
|
+
label: "Subject"
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
198
|
+
item: true,
|
|
199
|
+
xs: 12,
|
|
200
|
+
sm: 6,
|
|
201
|
+
children: /*#__PURE__*/_jsx(FormControl, {
|
|
202
|
+
fullWidth: true,
|
|
203
|
+
children: /*#__PURE__*/_jsx(Autocomplete, {
|
|
204
|
+
id: "ddlExamPack",
|
|
205
|
+
options: examPacks,
|
|
206
|
+
getOptionLabel: option => option.name,
|
|
207
|
+
value: selectedExamPack,
|
|
208
|
+
onChange: handleExamPackChange,
|
|
209
|
+
renderInput: params => /*#__PURE__*/_jsx(TextField, {
|
|
210
|
+
...params,
|
|
211
|
+
label: "Exam Pack"
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
})
|
|
215
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
216
|
+
item: true,
|
|
217
|
+
xs: 12,
|
|
218
|
+
sm: 6,
|
|
219
|
+
children: /*#__PURE__*/_jsx(FormControl, {
|
|
220
|
+
fullWidth: true,
|
|
221
|
+
children: /*#__PURE__*/_jsx(Autocomplete, {
|
|
222
|
+
id: "ddlExam",
|
|
223
|
+
options: exams,
|
|
224
|
+
getOptionLabel: option => option.examName,
|
|
225
|
+
value: selectedExam,
|
|
226
|
+
onChange: handleExamChange,
|
|
227
|
+
renderInput: params => /*#__PURE__*/_jsx(TextField, {
|
|
228
|
+
...params,
|
|
229
|
+
label: "Exam"
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
234
|
+
item: true,
|
|
235
|
+
xs: 12,
|
|
236
|
+
sm: 6,
|
|
237
|
+
children: /*#__PURE__*/_jsx(FormControl, {
|
|
238
|
+
fullWidth: true,
|
|
239
|
+
children: /*#__PURE__*/_jsx(Autocomplete, {
|
|
240
|
+
id: "ddlUser",
|
|
241
|
+
options: users,
|
|
242
|
+
getOptionLabel: option => option.userName,
|
|
243
|
+
value: selectedUser,
|
|
244
|
+
onChange: handleUserChange,
|
|
245
|
+
renderInput: params => /*#__PURE__*/_jsx(TextField, {
|
|
246
|
+
...params,
|
|
247
|
+
label: "User"
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
})
|
|
251
|
+
})]
|
|
252
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
253
|
+
sx: {
|
|
254
|
+
mt: 3,
|
|
255
|
+
position: 'relative'
|
|
256
|
+
},
|
|
257
|
+
children: [/*#__PURE__*/_jsx(FormControlLabel, {
|
|
258
|
+
control: /*#__PURE__*/_jsx(Checkbox, {
|
|
259
|
+
checked: onlyWrongAnswers,
|
|
260
|
+
onChange: e => setOnlyWrongAnswers(e.target.checked)
|
|
261
|
+
}),
|
|
262
|
+
label: "Only Wrong Answers"
|
|
263
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
264
|
+
sx: {
|
|
265
|
+
mt: 2,
|
|
266
|
+
position: 'relative'
|
|
267
|
+
},
|
|
268
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
269
|
+
variant: "contained",
|
|
270
|
+
color: "primary",
|
|
271
|
+
onClick: handleDownload,
|
|
272
|
+
disabled: !selectedSubject || !selectedExamPack || !selectedExam || !selectedUser || loading,
|
|
273
|
+
sx: {
|
|
274
|
+
width: 'auto',
|
|
275
|
+
backgroundColor: '#3f51b5',
|
|
276
|
+
'&:hover': {
|
|
277
|
+
backgroundColor: '#303f9f'
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
children: loading ? 'Downloading...' : 'Download Report'
|
|
281
|
+
}), loading && /*#__PURE__*/_jsx(CircularProgress, {
|
|
282
|
+
size: 24,
|
|
283
|
+
sx: {
|
|
284
|
+
position: 'absolute',
|
|
285
|
+
top: '50%',
|
|
286
|
+
left: '50%',
|
|
287
|
+
marginTop: '-12px',
|
|
288
|
+
marginLeft: '-12px'
|
|
289
|
+
}
|
|
290
|
+
})]
|
|
291
|
+
})]
|
|
292
|
+
})]
|
|
293
|
+
})
|
|
294
|
+
}), /*#__PURE__*/_jsx(Snackbar, {
|
|
295
|
+
open: openAlert,
|
|
296
|
+
autoHideDuration: 6000,
|
|
297
|
+
onClose: () => setOpenAlert(false),
|
|
298
|
+
anchorOrigin: {
|
|
299
|
+
vertical: 'top',
|
|
300
|
+
horizontal: 'center'
|
|
301
|
+
},
|
|
302
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
303
|
+
onClose: () => setOpenAlert(false),
|
|
304
|
+
severity: "info",
|
|
305
|
+
sx: {
|
|
306
|
+
width: '100%'
|
|
307
|
+
},
|
|
308
|
+
children: alertMessage
|
|
309
|
+
})
|
|
310
|
+
})]
|
|
311
|
+
})]
|
|
312
|
+
});
|
|
298
313
|
}
|
|
299
|
-
|
|
314
|
+
export default Report;
|
package/dist/api/client.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
class TenantApiClient {
|
|
8
2
|
constructor(config) {
|
|
9
3
|
this.baseURL = config.baseURL;
|
|
@@ -41,4 +35,4 @@ class TenantApiClient {
|
|
|
41
35
|
});
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
|
-
|
|
38
|
+
export default TenantApiClient;
|
|
@@ -1,68 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
-
// Import Drawer from antd
|
|
30
|
-
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { FaPowerOff } from "react-icons/fa";
|
|
4
|
+
import { MdFiberManualRecord, MdLogout, MdOutlineLockReset } from "react-icons/md";
|
|
5
|
+
import { IoIosList, IoIosSettings } from "react-icons/io";
|
|
6
|
+
import { GiHamburgerMenu } from "react-icons/gi";
|
|
7
|
+
import Popover from '@mui/material/Popover';
|
|
8
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
9
|
+
import "./Header.css";
|
|
10
|
+
import { MdKeyboardArrowDown, MdAssignment } from "react-icons/md";
|
|
11
|
+
import { RiHome5Fill, RiLogoutCircleRLine, RiMenuFoldLine } from "react-icons/ri";
|
|
12
|
+
import { HiBookmarkSquare, HiOutlineUser } from "react-icons/hi2";
|
|
13
|
+
import { TbDeviceMobileFilled } from "react-icons/tb";
|
|
14
|
+
import { IoBookOutline, IoCalendar, IoCalendarOutline, IoCartOutline, IoLanguage, IoLibraryOutline, IoLogOutOutline, IoPencilOutline, IoPersonCircleOutline, IoPersonOutline, IoSettingsOutline, IoShuffle, IoShuffleOutline } from "react-icons/io5";
|
|
15
|
+
import { TfiMenuAlt } from "react-icons/tfi";
|
|
16
|
+
import { RotatingLines } from 'react-loader-spinner';
|
|
17
|
+
import { Drawer } from 'antd'; // Import Drawer from antd
|
|
18
|
+
import './Header.css';
|
|
19
|
+
import { BiSolidBookContent, BiSolidUserPin } from "react-icons/bi";
|
|
20
|
+
import { FaCheck, FaCircleInfo } from "react-icons/fa6";
|
|
21
|
+
import { PiExamFill, PiShuffleAngularBold } from "react-icons/pi";
|
|
22
|
+
import { RiRedPacketLine } from "react-icons/ri";
|
|
23
|
+
import { MdMenuBook, MdKeyboardArrowRight, MdCorporateFare } from "react-icons/md";
|
|
24
|
+
import { IoGameControllerSharp } from "react-icons/io5";
|
|
25
|
+
import commonImagePathUrlPrefix, { logo } from './imagePathUrl';
|
|
26
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
27
|
const Header = () => {
|
|
32
|
-
const navigate =
|
|
33
|
-
const [show, setShow] =
|
|
34
|
-
const location =
|
|
35
|
-
const [activeMenuItem, setActiveMenuItem] =
|
|
36
|
-
const [isSideMenu, setSideMenu] =
|
|
37
|
-
const [userChooseLan, setUserChooseLan] =
|
|
38
|
-
const [drawerVisible, setDrawerVisible] =
|
|
39
|
-
const [userEmail] =
|
|
40
|
-
const [userName] =
|
|
28
|
+
const navigate = useNavigate();
|
|
29
|
+
const [show, setShow] = useState(false);
|
|
30
|
+
const location = useLocation();
|
|
31
|
+
const [activeMenuItem, setActiveMenuItem] = useState(location.pathname);
|
|
32
|
+
const [isSideMenu, setSideMenu] = useState("");
|
|
33
|
+
const [userChooseLan, setUserChooseLan] = useState("en");
|
|
34
|
+
const [drawerVisible, setDrawerVisible] = useState(false);
|
|
35
|
+
const [userEmail] = useState(localStorage.getItem("email"));
|
|
36
|
+
const [userName] = useState(localStorage.getItem("fName") + " " + localStorage.getItem("lName"));
|
|
41
37
|
const roleId = localStorage.getItem("roleId");
|
|
42
|
-
const [manageContentSubMenuOpen, setManageContentSubMenuOpen] =
|
|
43
|
-
const [manageExamSubMenuOpen, setManageExamSubMenuOpen] =
|
|
44
|
-
const [managePackSubMenuOpen, setManagePackSubMenuOpen] =
|
|
45
|
-
const [manageUserSubMenuOpen, setManageUserSubMenuOpen] =
|
|
46
|
-
const [manageCorporateSubMenuOpen, setManageCorporateSubMenuOpen] =
|
|
47
|
-
const [manageControlSubMenuOpen, setManageControlSubMenuOpen] =
|
|
48
|
-
const [usernames, setUserNames] =
|
|
49
|
-
const [userimg, setUserImg] =
|
|
50
|
-
const [availableCredit, setAvailableCredit] =
|
|
51
|
-
const [buyCredit, setbuyCredit] =
|
|
52
|
-
const [storageB, setStroageB] =
|
|
53
|
-
const [storagelimit, setStorageLimit] =
|
|
54
|
-
const [buy, setbuy] =
|
|
55
|
-
const [totalbuy, settotalbuy] =
|
|
38
|
+
const [manageContentSubMenuOpen, setManageContentSubMenuOpen] = useState(false);
|
|
39
|
+
const [manageExamSubMenuOpen, setManageExamSubMenuOpen] = useState(false);
|
|
40
|
+
const [managePackSubMenuOpen, setManagePackSubMenuOpen] = useState(false);
|
|
41
|
+
const [manageUserSubMenuOpen, setManageUserSubMenuOpen] = useState(false);
|
|
42
|
+
const [manageCorporateSubMenuOpen, setManageCorporateSubMenuOpen] = useState(false);
|
|
43
|
+
const [manageControlSubMenuOpen, setManageControlSubMenuOpen] = useState(false);
|
|
44
|
+
const [usernames, setUserNames] = useState("");
|
|
45
|
+
const [userimg, setUserImg] = useState("");
|
|
46
|
+
const [availableCredit, setAvailableCredit] = useState("");
|
|
47
|
+
const [buyCredit, setbuyCredit] = useState("");
|
|
48
|
+
const [storageB, setStroageB] = useState("");
|
|
49
|
+
const [storagelimit, setStorageLimit] = useState("");
|
|
50
|
+
const [buy, setbuy] = useState('');
|
|
51
|
+
const [totalbuy, settotalbuy] = useState('');
|
|
56
52
|
const token = localStorage.getItem("token");
|
|
57
53
|
const headers = {
|
|
58
54
|
Authorization: `Bearer ${token}`
|
|
59
55
|
};
|
|
60
56
|
const name = localStorage.getItem("fName");
|
|
61
|
-
const [showAlert, setShowAlert] =
|
|
62
|
-
const [alertMessage, setAlertMessage] =
|
|
57
|
+
const [showAlert, setShowAlert] = useState(false);
|
|
58
|
+
const [alertMessage, setAlertMessage] = useState('');
|
|
63
59
|
const userImage = localStorage.getItem("profileImg");
|
|
64
|
-
const [userNameEvaluator] =
|
|
65
|
-
|
|
60
|
+
const [userNameEvaluator] = useState(localStorage.getItem("userName"));
|
|
61
|
+
useEffect(() => {
|
|
66
62
|
if (localStorage.getItem("consentChkFlg") === "false") {
|
|
67
63
|
// navigate("/myProfile")
|
|
68
64
|
} else {
|
|
@@ -92,15 +88,15 @@ const Header = () => {
|
|
|
92
88
|
// useEffect(() => {
|
|
93
89
|
|
|
94
90
|
// }, []);
|
|
95
|
-
|
|
91
|
+
useEffect(() => {
|
|
96
92
|
window.scrollTo(0, 0);
|
|
97
93
|
document.addEventListener("click", handleOutsideClick);
|
|
98
94
|
return () => {
|
|
99
95
|
document.removeEventListener("click", handleOutsideClick);
|
|
100
96
|
};
|
|
101
97
|
}, []);
|
|
102
|
-
const [anchorEl, setAnchorEl] =
|
|
103
|
-
const [anchorLang, setAnchorLang] =
|
|
98
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
99
|
+
const [anchorLang, setAnchorLang] = useState(null);
|
|
104
100
|
const handleClick = event => {
|
|
105
101
|
setAnchorEl(event.currentTarget);
|
|
106
102
|
};
|
|
@@ -126,22 +122,24 @@ const Header = () => {
|
|
|
126
122
|
// navigate('/login'); // Navigate to login page
|
|
127
123
|
window.location.reload();
|
|
128
124
|
};
|
|
129
|
-
return /*#__PURE__*/
|
|
130
|
-
className: "header_whole_container"
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
125
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
126
|
+
className: "header_whole_container",
|
|
127
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
128
|
+
style: {
|
|
129
|
+
display: "flex",
|
|
130
|
+
alignItems: "center"
|
|
131
|
+
}
|
|
132
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
133
|
+
className: "acc_conf_main",
|
|
134
|
+
onClick: handleLogout,
|
|
135
|
+
children: /*#__PURE__*/_jsx(FaPowerOff, {
|
|
136
|
+
tabIndex: 0,
|
|
137
|
+
size: 30,
|
|
138
|
+
"aria-describedby": id,
|
|
139
|
+
variant: "contained",
|
|
140
|
+
className: "account-mnu-icon"
|
|
141
|
+
})
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
146
144
|
};
|
|
147
|
-
|
|
145
|
+
export default Header;
|