@campxdev/shared 1.8.13 → 1.8.14

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.
Files changed (266) hide show
  1. package/package.json +20 -4
  2. package/antd.customize.less +0 -73
  3. package/exports.ts +0 -19
  4. package/src/assets/fonts/avenir/Avenir-Book.ttf +0 -0
  5. package/src/assets/fonts/avenir/Avenir-Heavy.ttf +0 -0
  6. package/src/assets/fonts/avenir/Avenir-HeavyOblique.ttf +0 -0
  7. package/src/assets/fonts/avenir/Avenir-Medium.ttf +0 -0
  8. package/src/assets/fonts/avenir/Avenir-MediumOblique.ttf +0 -0
  9. package/src/assets/fonts/avenir/index.ts +0 -13
  10. package/src/assets/fonts/poppins/Poppins-Bold.ttf +0 -0
  11. package/src/assets/fonts/poppins/Poppins-Italic.ttf +0 -0
  12. package/src/assets/fonts/poppins/Poppins-Light.ttf +0 -0
  13. package/src/assets/fonts/poppins/Poppins-LightItalic.ttf +0 -0
  14. package/src/assets/fonts/poppins/Poppins-Medium.ttf +0 -0
  15. package/src/assets/fonts/poppins/Poppins-MediumItalic.ttf +0 -0
  16. package/src/assets/fonts/poppins/Poppins-Regular.ttf +0 -0
  17. package/src/assets/fonts/poppins/Poppins-SemiBold.ttf +0 -0
  18. package/src/assets/fonts/poppins/Poppins-SemiBoldItalic.ttf +0 -0
  19. package/src/assets/fonts/poppins/index.ts +0 -18
  20. package/src/assets/images/401.png +0 -0
  21. package/src/assets/images/403.png +0 -0
  22. package/src/assets/images/404.png +0 -0
  23. package/src/assets/images/404notfound.svg +0 -1
  24. package/src/assets/images/500.png +0 -0
  25. package/src/assets/images/avatar.png +0 -0
  26. package/src/assets/images/campx_logo__full_primary.png +0 -0
  27. package/src/assets/images/index.ts +0 -17
  28. package/src/assets/images/internalservererror.svg +0 -1
  29. package/src/assets/images/noInternet.svg +0 -1
  30. package/src/assets/images/nointernet.png +0 -0
  31. package/src/assets/images/notfound.png +0 -0
  32. package/src/assets/images/pagenotfound.svg +0 -1
  33. package/src/assets/images/permissiondenied.svg +0 -1
  34. package/src/assets/images/unauth.svg +0 -92
  35. package/src/components/ActionButton.tsx +0 -20
  36. package/src/components/Attachment.tsx +0 -26
  37. package/src/components/AutocompleteSearch/AutocompleteSearch.tsx +0 -57
  38. package/src/components/AutocompleteSearch/index.tsx +0 -1
  39. package/src/components/Breadcrumbs.tsx +0 -72
  40. package/src/components/Card.tsx +0 -98
  41. package/src/components/CardsGrid.tsx +0 -28
  42. package/src/components/ChangePassword.tsx +0 -123
  43. package/src/components/Chips.tsx +0 -81
  44. package/src/components/Detail.tsx +0 -15
  45. package/src/components/DetailsGrid.tsx +0 -52
  46. package/src/components/DividerHeading.tsx +0 -41
  47. package/src/components/DrawerWrapper/DialogWrapper.tsx +0 -67
  48. package/src/components/DrawerWrapper/DrawerTemplate.tsx +0 -53
  49. package/src/components/DrawerWrapper/DrawerWrapper.tsx +0 -53
  50. package/src/components/DropDownButton/AnchorElement.tsx +0 -44
  51. package/src/components/DropDownButton/DropDownButton.tsx +0 -184
  52. package/src/components/DropDownButton/DropdownMenuItem.tsx +0 -110
  53. package/src/components/DropDownButton/index.tsx +0 -1
  54. package/src/components/DropDownButton/styles.tsx +0 -59
  55. package/src/components/ErrorBoundary/ErrorBoundary.tsx +0 -33
  56. package/src/components/ErrorBoundary/ErrorFallback.tsx +0 -241
  57. package/src/components/ErrorBoundary/GlobalNetworkLoadingIndicator.tsx +0 -13
  58. package/src/components/ErrorBoundary/index.tsx +0 -1
  59. package/src/components/ErrorBox.tsx +0 -42
  60. package/src/components/ExcelToJsonInput/ExcelJsonUpload.tsx +0 -50
  61. package/src/components/ExcelToJsonInput/ExcelToJsonInput.tsx +0 -57
  62. package/src/components/ExcelToJsonInput/index.tsx +0 -1
  63. package/src/components/FilterComponents/FilterButton.tsx +0 -56
  64. package/src/components/FilterComponents/SearchBar.tsx +0 -45
  65. package/src/components/FloatingContainer.tsx +0 -33
  66. package/src/components/Form/Form.tsx +0 -147
  67. package/src/components/Form/RenderForm.tsx +0 -189
  68. package/src/components/FullScreenLoader.tsx +0 -19
  69. package/src/components/HookForm/AutoCompleteSearch.tsx +0 -113
  70. package/src/components/HookForm/DatePicker.tsx +0 -40
  71. package/src/components/HookForm/DateTimePicker.tsx +0 -47
  72. package/src/components/HookForm/FormLabel.tsx +0 -14
  73. package/src/components/HookForm/MultiCheckbox.tsx +0 -69
  74. package/src/components/HookForm/MultiSelect.tsx +0 -53
  75. package/src/components/HookForm/RadioGroup.tsx +0 -47
  76. package/src/components/HookForm/SingleCheckbox.tsx +0 -34
  77. package/src/components/HookForm/SingleSelect.tsx +0 -46
  78. package/src/components/HookForm/TextField.tsx +0 -40
  79. package/src/components/HookForm/TimePicker.tsx +0 -40
  80. package/src/components/HookForm/index.ts +0 -23
  81. package/src/components/IconButtons/IconButtons.tsx +0 -137
  82. package/src/components/IconButtons/Icons.tsx +0 -268
  83. package/src/components/IconButtons/assets/edit.svg +0 -4
  84. package/src/components/IconButtons/assets/eye.svg +0 -6
  85. package/src/components/IconButtons/assets/trash.svg +0 -7
  86. package/src/components/IconButtons/index.tsx +0 -8
  87. package/src/components/IconLabel.tsx +0 -37
  88. package/src/components/Image/Image.tsx +0 -45
  89. package/src/components/Image/broken-image.png +0 -0
  90. package/src/components/Image/index.tsx +0 -1
  91. package/src/components/ImageUpload.tsx +0 -98
  92. package/src/components/Input/AsyncSearchSelect/AsyncSearchSelect.tsx +0 -216
  93. package/src/components/Input/AsyncSearchSelect/index.tsx +0 -1
  94. package/src/components/Input/AsyncSearchSelect/styles.tsx +0 -105
  95. package/src/components/Input/AutoCompleteSearch.tsx +0 -121
  96. package/src/components/Input/DatePicker.tsx +0 -87
  97. package/src/components/Input/DateRangePicker.tsx +0 -105
  98. package/src/components/Input/DateTimePicker.tsx +0 -84
  99. package/src/components/Input/FormLabel.tsx +0 -21
  100. package/src/components/Input/MultiCheckbox.tsx +0 -64
  101. package/src/components/Input/MultiSelect.tsx +0 -150
  102. package/src/components/Input/RadioGroup.tsx +0 -104
  103. package/src/components/Input/SingleCheckbox.tsx +0 -78
  104. package/src/components/Input/SingleSelect.tsx +0 -104
  105. package/src/components/Input/TextField.tsx +0 -46
  106. package/src/components/Input/TimePicker.tsx +0 -77
  107. package/src/components/Input/index.ts +0 -26
  108. package/src/components/Input/types.ts +0 -3
  109. package/src/components/JsonPreview.tsx +0 -7
  110. package/src/components/LabelValue.tsx +0 -21
  111. package/src/components/Layout/ChangePassword.tsx +0 -49
  112. package/src/components/Layout/Header/AppHeader.tsx +0 -112
  113. package/src/components/Layout/Header/AppsMenu.tsx +0 -105
  114. package/src/components/Layout/Header/HeaderActions/CogWheelMenu.tsx +0 -33
  115. package/src/components/Layout/Header/HeaderActions/FreshDeskHelpButton.tsx +0 -24
  116. package/src/components/Layout/Header/HeaderActions/HeaderActions.tsx +0 -18
  117. package/src/components/Layout/Header/HeaderActions/UserBox.tsx +0 -56
  118. package/src/components/Layout/Header/Notification.tsx +0 -13
  119. package/src/components/Layout/Header/applications.ts +0 -103
  120. package/src/components/Layout/Header/assets/background.png +0 -0
  121. package/src/components/Layout/Header/assets/campx.png +0 -0
  122. package/src/components/Layout/Header/assets/campx_square_small.svg +0 -9
  123. package/src/components/Layout/Header/assets/commuteX.png +0 -0
  124. package/src/components/Layout/Header/assets/commutex.png +0 -0
  125. package/src/components/Layout/Header/assets/commutex.svg +0 -14
  126. package/src/components/Layout/Header/assets/commutexSmall.svg +0 -11
  127. package/src/components/Layout/Header/assets/contactBg.png +0 -0
  128. package/src/components/Layout/Header/assets/enroll.svg +0 -14
  129. package/src/components/Layout/Header/assets/enroll_logo.svg +0 -9
  130. package/src/components/Layout/Header/assets/enrollx.svg +0 -14
  131. package/src/components/Layout/Header/assets/entrollx.png +0 -0
  132. package/src/components/Layout/Header/assets/exams_small.svg +0 -12
  133. package/src/components/Layout/Header/assets/examsx.svg +0 -14
  134. package/src/components/Layout/Header/assets/examx.png +0 -0
  135. package/src/components/Layout/Header/assets/hostel_small.svg +0 -13
  136. package/src/components/Layout/Header/assets/hostelx.png +0 -0
  137. package/src/components/Layout/Header/assets/hostelx.svg +0 -13
  138. package/src/components/Layout/Header/assets/index.ts +0 -35
  139. package/src/components/Layout/Header/assets/libraryx.svg +0 -12
  140. package/src/components/Layout/Header/assets/libreryx.png +0 -0
  141. package/src/components/Layout/Header/assets/pay_small.svg +0 -16
  142. package/src/components/Layout/Header/assets/payx.png +0 -0
  143. package/src/components/Layout/Header/assets/payx.svg +0 -19
  144. package/src/components/Layout/Header/assets/people_small.svg +0 -9
  145. package/src/components/Layout/Header/assets/peoplex.svg +0 -12
  146. package/src/components/Layout/Header/assets/pepolex.png +0 -0
  147. package/src/components/Layout/Header/assets/squarex.svg +0 -12
  148. package/src/components/Layout/Header/icons.tsx +0 -57
  149. package/src/components/Layout/Header/index.tsx +0 -1
  150. package/src/components/Layout/Header/styles.tsx +0 -133
  151. package/src/components/Layout/Helmet.tsx +0 -49
  152. package/src/components/Layout/LayoutWrapper.tsx +0 -28
  153. package/src/components/Layout/SideMenuHeader.tsx +0 -29
  154. package/src/components/Layout/SideNav.tsx +0 -168
  155. package/src/components/Layout/Tickets/HelpWidget/HelpWidget.tsx +0 -273
  156. package/src/components/Layout/Tickets/HelpWidget/styles.tsx +0 -94
  157. package/src/components/Layout/Tickets/MyTickets.tsx +0 -72
  158. package/src/components/Layout/Tickets/TicketDetails.tsx +0 -65
  159. package/src/components/Layout/Tickets/TimeLine.tsx +0 -64
  160. package/src/components/Layout/Tickets/index.tsx +0 -1
  161. package/src/components/Layout/Tickets/services.ts +0 -11
  162. package/src/components/Layout/Tickets/styles.tsx +0 -136
  163. package/src/components/LinearProgress.tsx +0 -19
  164. package/src/components/ListItemButton.tsx +0 -95
  165. package/src/components/LoginForm.tsx +0 -279
  166. package/src/components/MediaRow/MediaRow.tsx +0 -67
  167. package/src/components/MediaRow/index.tsx +0 -1
  168. package/src/components/ModalButtons/DialogButton.tsx +0 -126
  169. package/src/components/ModalButtons/DrawerButton.tsx +0 -115
  170. package/src/components/ModalButtons/index.tsx +0 -4
  171. package/src/components/NoDataIllustration.tsx +0 -32
  172. package/src/components/PageContent.tsx +0 -12
  173. package/src/components/PageHeader.tsx +0 -55
  174. package/src/components/PageNotFound.tsx +0 -26
  175. package/src/components/PopupConfirm/ConfirmContextProvider.tsx +0 -40
  176. package/src/components/PopupConfirm/PopupConfirm.tsx +0 -67
  177. package/src/components/PopupConfirm/animation.gif +0 -0
  178. package/src/components/PopupConfirm/index.tsx +0 -1
  179. package/src/components/PopupConfirm/useConfirm.ts +0 -47
  180. package/src/components/ResetPassword.tsx +0 -107
  181. package/src/components/Row.tsx +0 -24
  182. package/src/components/Spinner.tsx +0 -18
  183. package/src/components/StepsHeader/StepsHeader.tsx +0 -115
  184. package/src/components/StepsHeader/index.tsx +0 -1
  185. package/src/components/StyledTableContainer.tsx +0 -33
  186. package/src/components/SwitchButton.tsx +0 -41
  187. package/src/components/Table.tsx +0 -42
  188. package/src/components/Tables/BasicTable/Table.tsx +0 -198
  189. package/src/components/Tables/BasicTable/TableFooter.tsx +0 -86
  190. package/src/components/Tables/BasicTable/index.tsx +0 -1
  191. package/src/components/Tables/ReactTable/BatchActionsHeader.tsx +0 -58
  192. package/src/components/Tables/ReactTable/ReactTable.tsx +0 -295
  193. package/src/components/Tables/ReactTable/RenderTableBody.tsx +0 -49
  194. package/src/components/Tables/ReactTable/index.tsx +0 -1
  195. package/src/components/Tables/ReactTable/react-table-config.d.ts +0 -128
  196. package/src/components/Tables/common/NoRecordsFound.tsx +0 -27
  197. package/src/components/Tables/common/TableStats.tsx +0 -22
  198. package/src/components/Tables/common/icons.tsx +0 -50
  199. package/src/components/Tables/common/no-data-illu.svg +0 -1
  200. package/src/components/Tables/common/styles.tsx +0 -170
  201. package/src/components/Tables/common/types.ts +0 -57
  202. package/src/components/Tabs/NavigationTabs.tsx +0 -80
  203. package/src/components/Tabs/Tabs.tsx +0 -53
  204. package/src/components/Tabs/TabsContainer.tsx +0 -53
  205. package/src/components/Tabs/index.tsx +0 -1
  206. package/src/components/Tabs/styles.tsx +0 -55
  207. package/src/components/ToastContainer/ToastContainer.tsx +0 -57
  208. package/src/components/ToastContainer/index.tsx +0 -1
  209. package/src/components/UploadButton/UploadButton.tsx +0 -126
  210. package/src/components/UploadButton/index.tsx +0 -1
  211. package/src/components/UploadButton/types.ts +0 -19
  212. package/src/components/UploadDocument.tsx +0 -108
  213. package/src/components/UploadFileDialog/AnimatedUploadFile.gif +0 -0
  214. package/src/components/UploadFileDialog/UploadFileDialog.tsx +0 -238
  215. package/src/components/UploadFileDialog/index.tsx +0 -1
  216. package/src/components/index.ts +0 -106
  217. package/src/config/axios.ts +0 -73
  218. package/src/config/axiosEvaluator.ts +0 -53
  219. package/src/config/axiosXTenant.ts +0 -57
  220. package/src/constants/UIConstants.ts +0 -97
  221. package/src/constants/formValidations.ts +0 -6
  222. package/src/constants/index.ts +0 -5
  223. package/src/constants/isDevelopment.ts +0 -4
  224. package/src/constants/permissions.ts +0 -67
  225. package/src/constants/validateMessages.ts +0 -12
  226. package/src/contexts/LoginFormProvider.tsx +0 -44
  227. package/src/contexts/Providers.tsx +0 -50
  228. package/src/contexts/PublicProviders.tsx +0 -30
  229. package/src/contexts/QueryClientProvider.tsx +0 -22
  230. package/src/hooks/index.ts +0 -4
  231. package/src/hooks/useAuth.ts +0 -96
  232. package/src/hooks/useFetch.ts +0 -53
  233. package/src/hooks/useFilters.ts +0 -83
  234. package/src/hooks/useRouter.ts +0 -31
  235. package/src/layouts/Components/DashBoardMenu.tsx +0 -232
  236. package/src/layouts/Components/icons/index.tsx +0 -403
  237. package/src/layouts/Components/styles.tsx +0 -74
  238. package/src/layouts/ComponentsLayout.tsx +0 -3
  239. package/src/permissions/PageWithPermission.tsx +0 -18
  240. package/src/permissions/PermissionDeniedPage.tsx +0 -16
  241. package/src/permissions/ValidateAccess.tsx +0 -18
  242. package/src/permissions/index.ts +0 -2
  243. package/src/react-app-env.d.ts +0 -1
  244. package/src/shared-state/AssetsStore.ts +0 -15
  245. package/src/shared-state/PermissionsStore.ts +0 -384
  246. package/src/shared-state/UserStore.ts +0 -13
  247. package/src/shared-state/index.ts +0 -4
  248. package/src/theme/App.less +0 -3
  249. package/src/theme/MuiThemeProvider.tsx +0 -18
  250. package/src/theme/customCssBaseline.ts +0 -135
  251. package/src/theme/index.css +0 -28
  252. package/src/theme/muiTheme.ts +0 -595
  253. package/src/theme/theme.d.ts +0 -75
  254. package/src/utils/adminAxios.ts +0 -15
  255. package/src/utils/alphabet.ts +0 -23
  256. package/src/utils/arrayPadEnd.ts +0 -3
  257. package/src/utils/formatCurrency.ts +0 -9
  258. package/src/utils/getUrlParams.ts +0 -5
  259. package/src/utils/index.ts +0 -7
  260. package/src/utils/logout.ts +0 -25
  261. package/src/utils/ordinalSuffixOf.ts +0 -14
  262. package/src/utils/romanize.ts +0 -40
  263. package/src/utils/withRouteWrapper.tsx +0 -25
  264. package/src/utils/withSuspense.tsx +0 -6
  265. package/styled-components.tsx +0 -60
  266. package/tsconfig.json +0 -21
@@ -1,77 +0,0 @@
1
- import { QueryBuilder } from '@mui/icons-material'
2
- import { InputAdornment, TextFieldProps } from '@mui/material'
3
- import 'flatpickr/dist/flatpickr.css'
4
- import { ReactNode } from 'react'
5
- import Flatpickr, { DateTimePickerProps } from 'react-flatpickr'
6
- import TextField from './TextField'
7
-
8
- export interface ITimePicker {
9
- label?: ReactNode
10
- name?: string
11
- required?: boolean
12
- minTime?: Date | string | number
13
- maxTime?: Date | string | number
14
- value: Date | null
15
- onChange: (value: Date) => void
16
- placeholder?: string
17
- inputProps?: TextFieldProps
18
- size?: 'medium' | 'small'
19
- }
20
-
21
- export default function TimePicker({
22
- name,
23
- label,
24
- required,
25
- minTime,
26
- maxTime,
27
- onChange,
28
- value,
29
- placeholder,
30
- size = 'medium',
31
- ...rest
32
- }: ITimePicker) {
33
- return (
34
- <Flatpickr
35
- options={{
36
- enableTime: true,
37
- noCalendar: true,
38
- dateFormat: 'h:i K',
39
- minTime,
40
- maxTime,
41
- allowInput: true,
42
- }}
43
- onClose={(dates) => {
44
- if (onChange) onChange(dates[0])
45
- }}
46
- onChange={(dates: Date[]) => {
47
- if (onChange) onChange(dates[0])
48
- }}
49
- value={value || null}
50
- render={(
51
- props: Omit<DateTimePickerProps, 'options' | 'render'>,
52
- ref: (node: HTMLInputElement | null) => void,
53
- ) => {
54
- return (
55
- <TextField
56
- size={size}
57
- placeholder={placeholder}
58
- label={label}
59
- name={name}
60
- variant="outlined"
61
- autoComplete="off"
62
- required={required}
63
- inputRef={ref}
64
- InputProps={{
65
- endAdornment: (
66
- <InputAdornment position="end">
67
- <QueryBuilder />
68
- </InputAdornment>
69
- ),
70
- }}
71
- {...rest.inputProps}
72
- />
73
- )
74
- }}
75
- />
76
- )
77
- }
@@ -1,26 +0,0 @@
1
- import TextField from './TextField'
2
- import DateTimePicker from './DateTimePicker'
3
- import FormLabel from './FormLabel'
4
- import MultiCheckbox from './MultiCheckbox'
5
- import MultiSelect from './MultiSelect'
6
- import RadioGroup from './RadioGroup'
7
- import SingleCheckbox from './SingleCheckbox'
8
- import SingleSelect from './SingleSelect'
9
- import AutoCompleteSearch from './AutoCompleteSearch'
10
- import TimePicker from './TimePicker'
11
- import DatePicker from './DatePicker'
12
- import DateRangePicker from './DateRangePicker'
13
- export {
14
- TextField,
15
- DateTimePicker,
16
- FormLabel,
17
- MultiCheckbox,
18
- MultiSelect,
19
- RadioGroup,
20
- SingleCheckbox,
21
- SingleSelect,
22
- AutoCompleteSearch,
23
- TimePicker,
24
- DatePicker,
25
- DateRangePicker,
26
- }
@@ -1,3 +0,0 @@
1
- import { ReactNode } from 'react'
2
-
3
- export type IOption = { label: ReactNode; value: any }
@@ -1,7 +0,0 @@
1
- export default function JsonPreview({ data }: { data: any }) {
2
- return (
3
- <div>
4
- <pre>{JSON.stringify(data, null, 2)}</pre>
5
- </div>
6
- )
7
- }
@@ -1,21 +0,0 @@
1
- import { Box, Stack, Typography } from '@mui/material'
2
- import { ReactNode } from 'react'
3
-
4
- export default function LabelValue({
5
- label,
6
- value,
7
- reverse = false,
8
- }: {
9
- label: string | ReactNode
10
- value?: ReactNode
11
- reverse?: boolean
12
- }) {
13
- return (
14
- <Stack flexDirection={reverse ? 'column-reverse' : 'column'} gap="6px">
15
- <Typography variant="subtitle2">{label}</Typography>
16
- <Typography paragraph fontWeight={600}>
17
- {value ?? '-'}
18
- </Typography>
19
- </Stack>
20
- )
21
- }
@@ -1,49 +0,0 @@
1
- import { Button, Stack } from '@mui/material'
2
- import { useForm } from 'react-hook-form'
3
- import { toast } from 'react-toastify'
4
- import { FormTextField } from '..'
5
- import axios, { axiosErrorToast } from '../../config/axios'
6
-
7
- export default function ChangePassword({ close }) {
8
- const { handleSubmit, control } = useForm()
9
-
10
- const onSubmit = async (formData) => {
11
- try {
12
- await axios.post('/auth-server/auth/change-password', formData)
13
- toast.success('Password Changed Successfully')
14
- } catch (error) {
15
- axiosErrorToast(error)
16
- }
17
- }
18
-
19
- return (
20
- <form onSubmit={handleSubmit(onSubmit)}>
21
- <Stack gap={2}>
22
- <FormTextField
23
- label="Old Password"
24
- control={control}
25
- name="oldPassword"
26
- required
27
- />
28
- <FormTextField
29
- label="New Password"
30
- control={control}
31
- name="newPassword"
32
- required
33
- />
34
- <FormTextField
35
- label="Confirm Password"
36
- control={control}
37
- name="password"
38
- required
39
- />
40
- <Stack>
41
- <Button variant="outlined" onClick={close}>
42
- Cancel
43
- </Button>
44
- <Button type="submit">Submit</Button>
45
- </Stack>
46
- </Stack>
47
- </form>
48
- )
49
- }
@@ -1,112 +0,0 @@
1
- import { Box, Button, Typography } from '@mui/material'
2
- import { ReactNode } from 'react'
3
- import { isDevelopment } from '../../../constants/isDevelopment'
4
- import { applications } from './applications'
5
- import AppsMenu from './AppsMenu'
6
- import {
7
- collegex,
8
- commutex,
9
- enrollx,
10
- examx,
11
- hostelx,
12
- payx,
13
- peoplex,
14
- } from './assets'
15
-
16
- import { HelpOutline } from '@mui/icons-material'
17
- import CogWheelMenu from './HeaderActions/CogWheelMenu'
18
- import {
19
- StyledHeader,
20
- StyledImageWrapper,
21
- StyledLogosWrapper,
22
- StyledRouterLink,
23
- } from './styles'
24
- import UserBox from './HeaderActions/UserBox'
25
- import FreshDeskHelpButton from './HeaderActions/FreshDeskHelpButton'
26
- import HeaderActions from './HeaderActions/HeaderActions'
27
-
28
- const imageMap = {
29
- ums: collegex,
30
- enroll: enrollx,
31
- exams: examx,
32
- payments: payx,
33
- people: peoplex,
34
- campx: collegex,
35
- commute: commutex,
36
- hostel: hostelx,
37
- }
38
-
39
- interface AppHeaderProps {
40
- clientLogo: string
41
- fullName: string
42
- userBoxActions: {
43
- label: ReactNode
44
- icon?: ReactNode
45
- onClick: any
46
- }[]
47
- customHeaderActions?: ReactNode
48
- cogWheelMenu?: { label: string; path: string }[]
49
- }
50
-
51
- export default function AppHeader({
52
- clientLogo = imageMap.campx,
53
- fullName,
54
- userBoxActions = [],
55
- cogWheelMenu = [],
56
- customHeaderActions,
57
- }: AppHeaderProps) {
58
- return (
59
- <StyledHeader>
60
- <Box sx={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
61
- <AppsMenu />
62
- <AppLogo clientLogo={clientLogo} />
63
- </Box>
64
- <Box className="actions">
65
- {customHeaderActions ? (
66
- customHeaderActions
67
- ) : (
68
- <HeaderActions
69
- cogWheelMenu={cogWheelMenu}
70
- fullName={fullName}
71
- userBoxActions={userBoxActions}
72
- />
73
- )}
74
- </Box>
75
- </StyledHeader>
76
- )
77
- }
78
-
79
- const AppLogo = ({ clientLogo }) => {
80
- const originSubdomain = window.location.host.split('.')?.slice(-3)[0] ?? 'ums'
81
- const currentApp =
82
- applications.find((item) => item.key === originSubdomain)?.key ?? 'campx'
83
-
84
- return (
85
- <StyledRouterLink to={'/'}>
86
- <StyledLogosWrapper>
87
- <StyledImageWrapper>
88
- <img src={imageMap[currentApp]} />
89
- </StyledImageWrapper>
90
- <Box
91
- sx={{
92
- height: '26px',
93
- width: '2px',
94
- background: 'gray',
95
- }}
96
- ></Box>
97
- <StyledImageWrapper>
98
- {isDevelopment ? (
99
- <Typography variant="h1">Developer</Typography>
100
- ) : (
101
- <img
102
- src={clientLogo}
103
- onError={(e: any) => {
104
- e.target.src = imageMap.campx
105
- }}
106
- />
107
- )}
108
- </StyledImageWrapper>
109
- </StyledLogosWrapper>
110
- </StyledRouterLink>
111
- )
112
- }
@@ -1,105 +0,0 @@
1
- import { Box, Menu, Typography } from '@mui/material'
2
- import Cookies from 'js-cookie'
3
- import { useState } from 'react'
4
- import { applications } from './applications'
5
- import { AppsIcon } from './icons'
6
- import {
7
- StyledDescription,
8
- StyledIconButton,
9
- StyledMenuItem,
10
- StyledMenuItemContainer,
11
- StyledLink,
12
- StyledImageBox,
13
- } from './styles'
14
-
15
- export const campxTenantKey = Cookies.get('campx_tenant')
16
-
17
- const AppsMenu = () => {
18
- const [anchorEl, setAnchorEl] = useState<any>(null)
19
- const open = Boolean(anchorEl)
20
-
21
- const handleClick = (event) => {
22
- setAnchorEl(event.currentTarget)
23
- }
24
-
25
- const handleClose = () => {
26
- setAnchorEl(null)
27
- }
28
-
29
- return (
30
- <>
31
- <StyledIconButton onClick={handleClick}>
32
- <AppsIcon />
33
- </StyledIconButton>
34
-
35
- <Menu
36
- transitionDuration={150}
37
- elevation={2}
38
- id="basic-menu"
39
- anchorEl={anchorEl}
40
- open={open}
41
- onClose={handleClose}
42
- anchorOrigin={{
43
- vertical: 'bottom',
44
- horizontal: 'left',
45
- }}
46
- transformOrigin={{
47
- vertical: 'top',
48
- horizontal: 'left',
49
- }}
50
- TransitionProps={{
51
- unmountOnExit: false,
52
- }}
53
- sx={{
54
- '& .MuiPaper-root': {
55
- left: '0 !important',
56
- top: '64px !important',
57
- '&>:last-child': {
58
- paddingBottom: '0px',
59
- },
60
- },
61
- }}
62
- >
63
- <Box sx={{ padding: '0.3rem 1rem' }}>
64
- <Typography variant="body2">Switch to</Typography>
65
- </Box>
66
- <Box>
67
- {applications.map((item, index) => (
68
- <StyledLink
69
- href={item.path + `/${campxTenantKey ?? ''}`}
70
- key={index}
71
- >
72
- <StyledMenuItemContainer
73
- key={index}
74
- onClick={() => {
75
- window.location.href = item.path
76
- handleClose()
77
- }}
78
- >
79
- <MenuItem data={item} />
80
- </StyledMenuItemContainer>
81
- </StyledLink>
82
- ))}
83
- </Box>
84
- </Menu>
85
- </>
86
- )
87
- }
88
-
89
- export default AppsMenu
90
-
91
- const MenuItem = ({ data }) => {
92
- return (
93
- <StyledMenuItem>
94
- <StyledImageBox>
95
- <img src={data.icon} style={{ width: '20px', height: '20px' }} />
96
- </StyledImageBox>
97
- <Box>
98
- <Typography variant="h1" sx={{ marginBottom: '7px' }}>
99
- {data?.title}
100
- </Typography>
101
- <StyledDescription>{data?.description}</StyledDescription>
102
- </Box>
103
- </StyledMenuItem>
104
- )
105
- }
@@ -1,33 +0,0 @@
1
- import { SettingsOutlined } from '@mui/icons-material'
2
- import { IconButton } from '@mui/material'
3
- import { useHistory } from '../../../../hooks/useRouter'
4
- import DropDownButton from '../../../DropDownButton/DropDownButton'
5
-
6
- const CogWheelMenu = ({ menu }) => {
7
- const history = useHistory()
8
-
9
- return (
10
- <DropDownButton
11
- anchor={({ open }) => (
12
- <IconButton color="secondary" onClick={open}>
13
- <SettingsOutlined />
14
- </IconButton>
15
- )}
16
- menu={menu?.map((item) => ({
17
- label: item?.label,
18
- onClick: () => {
19
- history.push(item?.path)
20
- },
21
- }))}
22
- menuProps={{
23
- PaperProps: { sx: { top: '56px !important' } },
24
- transformOrigin: {
25
- horizontal: 'center',
26
- vertical: 'top',
27
- },
28
- }}
29
- />
30
- )
31
- }
32
-
33
- export default CogWheelMenu
@@ -1,24 +0,0 @@
1
- import { HelpOutline } from '@mui/icons-material'
2
- import { Button } from '@mui/material'
3
-
4
- export default function FreshDeskHelpButton() {
5
- const handleOpenFreshDeskWidget = () => {
6
- try {
7
- ;(window as any)?.openFreshDeskWidget()
8
- } catch (error) {
9
- // eslint-disable-next-line no-console
10
- console.error('Error launching Freshdesk')
11
- }
12
- }
13
- return (
14
- <Button
15
- variant="text"
16
- color="secondary"
17
- startIcon={<HelpOutline />}
18
- onClick={handleOpenFreshDeskWidget}
19
- sx={{ padding: '20px' }}
20
- >
21
- Help
22
- </Button>
23
- )
24
- }
@@ -1,18 +0,0 @@
1
- import { Box } from '@mui/material'
2
- import UserBox from './UserBox'
3
- import CogWheelMenu from './CogWheelMenu'
4
- import FreshDeskHelpButton from './FreshDeskHelpButton'
5
-
6
- export default function HeaderActions({
7
- cogWheelMenu,
8
- fullName,
9
- userBoxActions,
10
- }) {
11
- return (
12
- <>
13
- <FreshDeskHelpButton />
14
- {cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null}
15
- <UserBox fullName={fullName} actions={userBoxActions} />
16
- </>
17
- )
18
- }
@@ -1,56 +0,0 @@
1
- import { ExitToAppOutlined, HttpsOutlined } from '@mui/icons-material'
2
- import logout from '../../../../utils/logout'
3
- import ChangePassword from '../../../ChangePassword'
4
- import DropDownButton from '../../../DropDownButton/DropDownButton'
5
- import { IMenuItemProps } from '../../../DropDownButton/DropdownMenuItem'
6
- import { StyledAvatar } from '../styles'
7
-
8
- const getStartingLetters = (text: string) => {
9
- if (!text) return ''
10
- return text
11
- .split(' ')
12
- ?.map((w) => w[0])
13
- ?.join('')
14
- }
15
-
16
- export default function UserBox({
17
- fullName,
18
- actions,
19
- customActions = [],
20
- }: {
21
- fullName: string
22
- actions: IMenuItemProps[] | []
23
- customActions?: IMenuItemProps[] | []
24
- }) {
25
- return (
26
- <DropDownButton
27
- anchor={({ open }) => (
28
- <StyledAvatar onClick={open}>
29
- {getStartingLetters(fullName)}
30
- </StyledAvatar>
31
- )}
32
- menu={
33
- customActions?.length
34
- ? customActions
35
- : [
36
- ...actions,
37
- {
38
- label: 'Change Password',
39
- actionType: 'dialog',
40
- icon: <HttpsOutlined />,
41
- content: ({ close }) => <ChangePassword close={close} />,
42
- contentTitle: 'Change Password',
43
- },
44
- {
45
- label: 'Logout',
46
- icon: <ExitToAppOutlined />,
47
- onClick: logout,
48
- },
49
- ]
50
- }
51
- menuProps={{
52
- PaperProps: { sx: { top: '56px !important' } },
53
- }}
54
- />
55
- )
56
- }
@@ -1,13 +0,0 @@
1
- import { IconButton } from '@mui/material'
2
- import { NotificationIcon } from './icons'
3
-
4
- function Notification() {
5
- return (
6
- <>
7
- <IconButton>
8
- <NotificationIcon />
9
- </IconButton>
10
- </>
11
- )
12
- }
13
- export default Notification
@@ -1,103 +0,0 @@
1
- import { isDevelopment } from '../../../constants'
2
- import {
3
- campxSquareSmall,
4
- examsSmall,
5
- hostelSmall,
6
- paySmall,
7
- peopleSmall,
8
- commuteSmall,
9
- enrollSmall,
10
- } from './assets'
11
-
12
- const origins = {
13
- ums: {
14
- dev: 'https://ums.campx.dev',
15
- prod: 'https://ums.campx.in',
16
- },
17
- payments: {
18
- dev: 'https://payments.campx.dev',
19
- prod: 'https://payments.campx.in',
20
- },
21
- exams: {
22
- dev: 'https://exams.campx.dev',
23
- prod: 'https://exams.campx.in',
24
- },
25
- people: {
26
- dev: 'https://people.campx.dev',
27
- prod: 'https://people.campx.in',
28
- },
29
- hostel: {
30
- dev: 'https://hostel.campx.dev',
31
- prod: 'https://hostel.campx.in',
32
- },
33
- commute: {
34
- dev: 'https://commute.campx.dev',
35
- prod: 'https://commute.campx.in',
36
- },
37
- enroll: {
38
- dev: 'https://enroll.campx.dev',
39
- prod: 'https://enroll.campx.in',
40
- },
41
- }
42
-
43
- export const applications = [
44
- {
45
- title: 'CollegeX',
46
- path: isDevelopment ? origins.ums.dev : origins.ums.prod,
47
- icon: campxSquareSmall,
48
- key: 'ums',
49
- description: 'Manage Complete Campus Activities',
50
- },
51
- {
52
- title: 'ExamX',
53
- key: 'exams',
54
- path: isDevelopment ? origins.exams.dev : origins.exams.prod,
55
- icon: examsSmall,
56
- description: 'Manage all Examinations in the Campus',
57
- },
58
- {
59
- title: 'PayX',
60
- key: 'payments',
61
- path: isDevelopment ? origins.payments.dev : origins.payments.prod,
62
- icon: paySmall,
63
- description: 'Manage Payments in the Campus',
64
- },
65
- {
66
- title: 'EnrollX',
67
- key: 'enroll',
68
- path: isDevelopment ? origins.enroll.dev : origins.enroll.prod,
69
- icon: enrollSmall,
70
- description: 'Manage Admissions in the Campus',
71
- },
72
- {
73
- title: 'HostelX',
74
- key: 'hostel',
75
- path: isDevelopment ? origins.hostel.dev : origins.hostel.prod,
76
- icon: hostelSmall,
77
- description: 'Manage Hostels in the Campus',
78
- },
79
- {
80
- title: 'CommuteX',
81
- key: 'commute',
82
- path: isDevelopment ? origins.commute.dev : origins.commute.prod,
83
- icon: commuteSmall,
84
- description: 'Manage Commute in the Campus',
85
- },
86
- ...(isDevelopment
87
- ? [
88
- {
89
- title: 'PeopleX',
90
- key: 'people',
91
- path: isDevelopment ? origins.people.dev : origins.people.prod,
92
- icon: peopleSmall,
93
- description: 'Manage People in the Campus',
94
- },
95
- ]
96
- : []),
97
- // {
98
- // title: 'EnrollX',
99
- // path: '/hostel',
100
- // icon: enrollHeaderLogo,
101
- // // description: 'Manage Admissions in the Campus',
102
- // },
103
- ]
@@ -1,9 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35" height="35" viewBox="0 0 35 35">
2
- <defs>
3
- <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
- <stop offset="0" stop-color="#596e79"/>
5
- <stop offset="1" stop-color="#7c909b"/>
6
- </linearGradient>
7
- </defs>
8
- <path id="Subtraction_7" data-name="Subtraction 7" d="M-5678.321,8264.99h-13.18v-13.234h6.563v6.672h6.617v6.563Zm21.82,0h-13.18v-6.562h6.617v-6.672h6.563v13.234Zm0-21.875h-6.562v-6.562h-6.617v-6.562h13.18v13.125Zm-28.437,0h-6.562V8229.99h13.18v6.563h-6.617v6.563Z" transform="translate(5691.501 -8229.99)" fill="url(#linear-gradient)"/>
9
- </svg>