@campxdev/shared 0.1.0
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/.eslintrc.js +34 -0
- package/.prettierrc +10 -0
- package/.storybook/main.js +16 -0
- package/.storybook/preview.js +9 -0
- package/antd.customize.less +73 -0
- package/exports.ts +20 -0
- package/package.json +78 -0
- package/public/dean.JPG +0 -0
- package/public/download.png +0 -0
- package/public/illustrations/bookmark.svg +19 -0
- package/public/illustrations/girl-writing.png +0 -0
- package/public/illustrations/whiteboard.svg +24 -0
- package/public/images/AnimatedUploadFile.gif +0 -0
- package/public/images/doc@2x.png +0 -0
- package/public/images/greenTick.png +0 -0
- package/public/images/jpg.png +0 -0
- package/public/images/paperclip@2x.png +0 -0
- package/public/images/pdf.png +0 -0
- package/public/images/ppt.png +0 -0
- package/public/images/profileImage.jpg +0 -0
- package/public/images/profileImage.png +0 -0
- package/public/index.html +50 -0
- package/public/logo.png +0 -0
- package/public/logo_campx_full.png +0 -0
- package/public/logo_square.svg +21 -0
- package/public/omr_sign.jpg +0 -0
- package/src/App.tsx +35 -0
- package/src/assets/fonts/avenir/Avenir.ttc +0 -0
- package/src/assets/fonts/avenir/index.ts +2 -0
- package/src/assets/fonts/poppins/Poppins-Bold.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Italic.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Light.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-LightItalic.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Medium.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-MediumItalic.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Regular.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-SemiBold.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/assets/fonts/poppins/index.ts +7 -0
- package/src/assets/images/File bundle-bro.svg +122 -0
- package/src/assets/images/Filebundle.png +0 -0
- package/src/assets/images/NoPart.png +0 -0
- package/src/assets/images/ResultProcess.png +0 -0
- package/src/assets/images/ResultProcess.svg +99 -0
- package/src/assets/images/attachment.svg +1 -0
- package/src/assets/images/avatar.png +0 -0
- package/src/assets/images/index.ts +19 -0
- package/src/assets/images/pdf.png +0 -0
- package/src/assets/images/taskAttachment.png +0 -0
- package/src/assets/images/welcomeimage.jpg +0 -0
- package/src/assets/static_files/External_Marks_Import .xlsx +0 -0
- package/src/assets/static_files/Leads_Sample.xlsx +0 -0
- package/src/assets/static_files/Subject_Topic_Import_Sheet.xlsx +0 -0
- package/src/assets/static_files/admissions_Sample.xlsx +0 -0
- package/src/assets/static_files/barcodes_template.xlsx +0 -0
- package/src/assets/static_files/hostel_rooms_import.xlsx +0 -0
- package/src/assets/static_files/index.ts +24 -0
- package/src/assets/static_files/sample_admissions.xlsx +0 -0
- package/src/assets/static_files/sample_admissions_report.xlsx +0 -0
- package/src/assets/static_files/sample_curriculum_subjects_template.xlsx +0 -0
- package/src/assets/static_files/sample_import_students_new.xlsx +0 -0
- package/src/assets/static_files/sample_internal_marks.xlsx +0 -0
- package/src/assets/static_files/sample_student_subjects_template.xlsx +0 -0
- package/src/components/ActionButton.tsx +28 -0
- package/src/components/Attachment.tsx +26 -0
- package/src/components/AutocompleteSearch/AutocompleteSearch.tsx +57 -0
- package/src/components/AutocompleteSearch/index.tsx +1 -0
- package/src/components/Breadcrumbs.tsx +73 -0
- package/src/components/Card.tsx +97 -0
- package/src/components/CardsGrid.tsx +28 -0
- package/src/components/Chips.tsx +77 -0
- package/src/components/Detail.tsx +15 -0
- package/src/components/DetailsGrid.tsx +52 -0
- package/src/components/DividerHeading.tsx +40 -0
- package/src/components/DrawerWrapper/DialogWrapper.tsx +63 -0
- package/src/components/DrawerWrapper/DrawerTemplate.tsx +53 -0
- package/src/components/DrawerWrapper/DrawerWrapper.tsx +53 -0
- package/src/components/DropDownButton.tsx +184 -0
- package/src/components/ErrorBoundary.js +45 -0
- package/src/components/ErrorBox.tsx +42 -0
- package/src/components/FloatingContainer.tsx +26 -0
- package/src/components/FullCalendar/Actions.tsx +162 -0
- package/src/components/FullCalendar/FullCalendarWrapper.tsx +54 -0
- package/src/components/HookForm/AutoCompleteSearch.tsx +143 -0
- package/src/components/HookForm/DatePicker.tsx +65 -0
- package/src/components/HookForm/DateTimePicker.tsx +70 -0
- package/src/components/HookForm/FormLabel.tsx +14 -0
- package/src/components/HookForm/MultiCheckbox.tsx +82 -0
- package/src/components/HookForm/MultiSelect.tsx +100 -0
- package/src/components/HookForm/RadioGroup.tsx +113 -0
- package/src/components/HookForm/SingleCheckbox.tsx +46 -0
- package/src/components/HookForm/SingleSelect.tsx +93 -0
- package/src/components/HookForm/TextField.tsx +74 -0
- package/src/components/HookForm/TimePicker.tsx +82 -0
- package/src/components/HookForm/index.ts +23 -0
- package/src/components/IconButtons/IconButtons.tsx +137 -0
- package/src/components/IconButtons/Icons.tsx +269 -0
- package/src/components/IconButtons/assets/edit.svg +4 -0
- package/src/components/IconButtons/assets/eye.svg +6 -0
- package/src/components/IconButtons/assets/trash.svg +7 -0
- package/src/components/IconButtons/index.tsx +8 -0
- package/src/components/IconLabel.tsx +37 -0
- package/src/components/Image/Image.tsx +43 -0
- package/src/components/Image/broken-image.png +0 -0
- package/src/components/Image/index.tsx +1 -0
- package/src/components/ImageUpload.tsx +98 -0
- package/src/components/Input/AutoCompleteSearch.tsx +143 -0
- package/src/components/Input/DatePicker.tsx +60 -0
- package/src/components/Input/DateRangePicker.tsx +131 -0
- package/src/components/Input/DateTimePicker.tsx +70 -0
- package/src/components/Input/FormLabel.tsx +14 -0
- package/src/components/Input/MultiCheckbox.tsx +79 -0
- package/src/components/Input/MultiSelect.tsx +52 -0
- package/src/components/Input/RadioGroup.tsx +55 -0
- package/src/components/Input/SingleCheckbox.tsx +23 -0
- package/src/components/Input/SingleSelect.tsx +139 -0
- package/src/components/Input/TextField.tsx +50 -0
- package/src/components/Input/TimePicker.tsx +82 -0
- package/src/components/Input/index.ts +26 -0
- package/src/components/JsonPreview/JsonPreview.tsx +7 -0
- package/src/components/JsonPreview/index.tsx +1 -0
- package/src/components/LabelValue/LabelValue.tsx +21 -0
- package/src/components/LabelValue/index.tsx +1 -0
- package/src/components/Layout/ChangePassword.tsx +49 -0
- package/src/components/Layout/Header/AppHeader.tsx +150 -0
- package/src/components/Layout/Header/CogWheelMenu.tsx +35 -0
- package/src/components/Layout/Header/FreshDeskHelpButton.tsx +19 -0
- package/src/components/Layout/Header/MainAppHeader.tsx +6 -0
- package/src/components/Layout/Header/Notification.tsx +13 -0
- package/src/components/Layout/Header/UserBox.tsx +51 -0
- package/src/components/Layout/Header/applications.tsx +39 -0
- package/src/components/Layout/Header/icons.tsx +57 -0
- package/src/components/Layout/Header/index.tsx +1 -0
- package/src/components/Layout/Header/styles.tsx +48 -0
- package/src/components/LinearProgress/LinearProgress.tsx +27 -0
- package/src/components/LinearProgress/index.tsx +1 -0
- package/src/components/MediaRow/MediaRow.tsx +69 -0
- package/src/components/MediaRow/index.tsx +1 -0
- package/src/components/MenuButton.tsx +105 -0
- package/src/components/ModalButtons/DialogButton.tsx +84 -0
- package/src/components/ModalButtons/DrawerButton.tsx +89 -0
- package/src/components/ModalButtons/index.tsx +4 -0
- package/src/components/NoDataIllustration/NoDataIllustration.tsx +32 -0
- package/src/components/NoDataIllustration/index.tsx +1 -0
- package/src/components/PageContent.tsx +14 -0
- package/src/components/PageHeader.tsx +52 -0
- package/src/components/PopupConfirm/ConfirmContextProvider.tsx +22 -0
- package/src/components/PopupConfirm/PopupConfirm.tsx +33 -0
- package/src/components/PopupConfirm/index.tsx +1 -0
- package/src/components/PopupConfirm/useConfirm.ts +47 -0
- package/src/components/Row/Row.tsx +24 -0
- package/src/components/Row/index.tsx +1 -0
- package/src/components/SearchBar/SearchBar.tsx +53 -0
- package/src/components/SearchBar/index.tsx +1 -0
- package/src/components/Spinner.tsx +18 -0
- package/src/components/StepsHeader/StepsHeader.tsx +115 -0
- package/src/components/StepsHeader/index.tsx +1 -0
- package/src/components/Styled/OutlinedIconButton.tsx +7 -0
- package/src/components/Styled/index.tsx +1 -0
- package/src/components/StyledTableContainer.tsx +33 -0
- package/src/components/Swiper/Swiper.tsx +39 -0
- package/src/components/Swiper/index.tsx +1 -0
- package/src/components/SwitchButton/SwitchButton.tsx +41 -0
- package/src/components/SwitchButton/index.tsx +1 -0
- package/src/components/TableComponent/BatchActionsHeader.tsx +58 -0
- package/src/components/TableComponent/Icons/index.tsx +50 -0
- package/src/components/TableComponent/ReactTable.tsx +293 -0
- package/src/components/TableComponent/RenderTableBody.tsx +65 -0
- package/src/components/TableComponent/TableFooter/TableFooter.tsx +102 -0
- package/src/components/TableComponent/TableFooter/index.tsx +1 -0
- package/src/components/TableComponent/TableFooter/styles.tsx +28 -0
- package/src/components/TableComponent/index.tsx +219 -0
- package/src/components/TableComponent/no-data-illu.svg +1 -0
- package/src/components/TableComponent/react-table-config.d.ts +129 -0
- package/src/components/TableComponent/styles.tsx +173 -0
- package/src/components/TableComponent/types.ts +57 -0
- package/src/components/Tabs/Tabs.tsx +52 -0
- package/src/components/Tabs/TabsContainer.tsx +50 -0
- package/src/components/Tabs/index.tsx +1 -0
- package/src/components/Tabs/styles.tsx +55 -0
- package/src/components/ToastContainer/ToastContainer.tsx +42 -0
- package/src/components/ToastContainer/index.tsx +1 -0
- package/src/components/UploadButton/UploadButton.tsx +98 -0
- package/src/components/UploadButton/index.tsx +1 -0
- package/src/components/UploadButton/types.ts +14 -0
- package/src/components/UploadDocument/UploadDocument.tsx +108 -0
- package/src/components/UploadDocument/index.tsx +1 -0
- package/src/components/UploadFileDialog/UploadFileDialog.tsx +240 -0
- package/src/components/UploadFileDialog/index.tsx +1 -0
- package/src/components/index.ts +59 -0
- package/src/config/axios.ts +138 -0
- package/src/constants/UIConstants.ts +97 -0
- package/src/constants/formValidations.ts +6 -0
- package/src/constants/index.ts +4 -0
- package/src/constants/permissions.ts +67 -0
- package/src/constants/validateMessages.ts +12 -0
- package/src/contexts/Providers.tsx +24 -0
- package/src/contexts/QueryClientProvider.tsx +22 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useFetch.ts +53 -0
- package/src/hooks/useRouter.ts +31 -0
- package/src/index.tsx +9 -0
- package/src/layouts/ComponentsLayout.tsx +3 -0
- package/src/pages/LoginPage/LoginPage.tsx +166 -0
- package/src/pages/LoginPage/index.ts +1 -0
- package/src/pages/LoginPage/styles.tsx +121 -0
- package/src/pages/index.ts +4 -0
- package/src/permissions/PageWithPermission.tsx +58 -0
- package/src/permissions/PermissionDeniedPage.tsx +23 -0
- package/src/permissions/PermissionsStore.ts +289 -0
- package/src/permissions/ValidateAccess.tsx +18 -0
- package/src/permissions/index.ts +3 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/shared-state/AssetsStore.ts +15 -0
- package/src/shared-state/UserStore.ts +13 -0
- package/src/shared-state/index.ts +3 -0
- package/src/stories/Button.stories.tsx +41 -0
- package/src/stories/Button.tsx +48 -0
- package/src/stories/Header.stories.tsx +25 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Introduction.stories.mdx +211 -0
- package/src/stories/Page.stories.tsx +26 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/TextField.stories.tsx +18 -0
- package/src/stories/TextField.tsx +49 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +69 -0
- package/src/theme/App.less +3 -0
- package/src/theme/MuiThemeProvider.tsx +11 -0
- package/src/theme/customCssBaseline.ts +78 -0
- package/src/theme/index.css +75 -0
- package/src/theme/muiTheme.ts +516 -0
- package/src/theme/theme.d.ts +75 -0
- package/src/utils/alphabet.ts +23 -0
- package/src/utils/arrayPadEnd.ts +3 -0
- package/src/utils/formatCurrency.ts +9 -0
- package/src/utils/getUrlParams.ts +5 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/ordinalSuffixOf.ts +14 -0
- package/src/utils/romanize.ts +40 -0
- package/src/utils/withRouteWrapper.tsx +25 -0
- package/src/utils/withSuspense.tsx +6 -0
- package/styled-components.tsx +60 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './JsonPreview'
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './LabelValue'
|
|
@@ -0,0 +1,49 @@
|
|
|
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/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
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Box, IconButton, Menu, styled, Typography } from '@mui/material'
|
|
2
|
+
import { AssetsStore } from '@campx/shared'
|
|
3
|
+
import CogWheelMenu from './CogWheelMenu'
|
|
4
|
+
import FreshDeskHelpButton from './FreshDeskHelpButton'
|
|
5
|
+
import { StyledHeader, StyledImageWrapper } from './styles'
|
|
6
|
+
import UserBox from './UserBox'
|
|
7
|
+
import { Link } from 'react-router-dom'
|
|
8
|
+
import { useState } from 'react'
|
|
9
|
+
import { applications } from './applications'
|
|
10
|
+
import { AppsIcon } from './icons'
|
|
11
|
+
import Notification from './Notification'
|
|
12
|
+
|
|
13
|
+
export default function AppHeader({ title }: { title?: string }) {
|
|
14
|
+
const assetState = AssetsStore.useState((s) => s)
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<StyledHeader>
|
|
18
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: '20px' }}>
|
|
19
|
+
<AppsMenu />
|
|
20
|
+
|
|
21
|
+
<Link to={'/'}>
|
|
22
|
+
{title ? (
|
|
23
|
+
<Typography variant="h1">{title}</Typography>
|
|
24
|
+
) : (
|
|
25
|
+
<StyledImageWrapper>
|
|
26
|
+
<img src={assetState.logo} />
|
|
27
|
+
</StyledImageWrapper>
|
|
28
|
+
)}
|
|
29
|
+
</Link>
|
|
30
|
+
</Box>
|
|
31
|
+
<Box className="actions">
|
|
32
|
+
<FreshDeskHelpButton />
|
|
33
|
+
<Notification />
|
|
34
|
+
<CogWheelMenu />
|
|
35
|
+
<UserBox />
|
|
36
|
+
</Box>
|
|
37
|
+
</StyledHeader>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const AppsMenu = () => {
|
|
42
|
+
const [anchorEl, setAnchorEl] = useState<any>(null)
|
|
43
|
+
const open = Boolean(anchorEl)
|
|
44
|
+
|
|
45
|
+
const handleClick = (event) => {
|
|
46
|
+
setAnchorEl(event.currentTarget)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const handleClose = () => {
|
|
50
|
+
setAnchorEl(null)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Box sx={{ marginRight: '10px' }}>
|
|
55
|
+
<StyledIconButton onClick={handleClick}>
|
|
56
|
+
<AppsIcon />
|
|
57
|
+
</StyledIconButton>
|
|
58
|
+
|
|
59
|
+
<Menu
|
|
60
|
+
elevation={2}
|
|
61
|
+
id="basic-menu"
|
|
62
|
+
anchorEl={anchorEl}
|
|
63
|
+
open={open}
|
|
64
|
+
onClose={handleClose}
|
|
65
|
+
MenuListProps={{
|
|
66
|
+
sx: {
|
|
67
|
+
padding: 0,
|
|
68
|
+
margin: 0,
|
|
69
|
+
},
|
|
70
|
+
}}
|
|
71
|
+
anchorOrigin={{
|
|
72
|
+
vertical: 'bottom',
|
|
73
|
+
horizontal: 'left',
|
|
74
|
+
}}
|
|
75
|
+
transformOrigin={{
|
|
76
|
+
vertical: 'top',
|
|
77
|
+
horizontal: 'left',
|
|
78
|
+
}}
|
|
79
|
+
sx={{
|
|
80
|
+
'& .MuiPaper-root': {
|
|
81
|
+
left: '0px',
|
|
82
|
+
},
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<Box sx={{ padding: '1rem 1.5rem' }}>
|
|
86
|
+
<Typography variant="h6">Switch to</Typography>
|
|
87
|
+
</Box>
|
|
88
|
+
<Box>
|
|
89
|
+
{applications.map((item, index) => (
|
|
90
|
+
<StyledMenuItemContainer
|
|
91
|
+
key={index}
|
|
92
|
+
onClick={() => {
|
|
93
|
+
handleClose()
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
<StyledMenuItem data={item} />
|
|
97
|
+
</StyledMenuItemContainer>
|
|
98
|
+
))}
|
|
99
|
+
</Box>
|
|
100
|
+
</Menu>
|
|
101
|
+
</Box>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const StyledMenuItem = ({ data }) => {
|
|
106
|
+
return (
|
|
107
|
+
<StyledMenuitem>
|
|
108
|
+
<Box>{data.icon}</Box>
|
|
109
|
+
<Box>
|
|
110
|
+
<Typography variant="h1">{data?.title}</Typography>
|
|
111
|
+
<StyledDescription>{data?.description}</StyledDescription>
|
|
112
|
+
</Box>
|
|
113
|
+
</StyledMenuitem>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const StyledIconButton = styled(IconButton)({
|
|
118
|
+
padding: '20px',
|
|
119
|
+
backgroundColor: 'black',
|
|
120
|
+
display: 'flex',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
borderRadius: '0px',
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const StyledDescription = styled(Typography)(({ theme }) => ({
|
|
127
|
+
fontSize: '15px',
|
|
128
|
+
fontWeight: 500,
|
|
129
|
+
color: theme?.palette?.secondary?.main,
|
|
130
|
+
}))
|
|
131
|
+
|
|
132
|
+
const StyledMenuitem = styled(Box)({
|
|
133
|
+
height: '72px',
|
|
134
|
+
width: '400px',
|
|
135
|
+
padding: '40px 20px',
|
|
136
|
+
'&:hover': {
|
|
137
|
+
background: 'rgba(0, 0, 0, 0.03)',
|
|
138
|
+
},
|
|
139
|
+
display: 'flex',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
gap: '10px',
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const StyledMenuItemContainer = styled(Box)(({ theme }) => ({
|
|
145
|
+
cursor: 'pointer',
|
|
146
|
+
borderBottom: `1px solid ${theme?.palette?.secondary?.lighter}`,
|
|
147
|
+
'&:last-of-type': {
|
|
148
|
+
border: 'none',
|
|
149
|
+
},
|
|
150
|
+
}))
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SettingsOutlined } from '@mui/icons-material'
|
|
2
|
+
import { IconButton } from '@mui/material'
|
|
3
|
+
import { useHistory } from '../../../hooks/useRouter'
|
|
4
|
+
import MenuButton from '../../MenuButton'
|
|
5
|
+
|
|
6
|
+
const profileMenu = [
|
|
7
|
+
{ label: 'Roles and Permissions', value: '/roles-and-permissions' },
|
|
8
|
+
{ label: 'Audit Logs', value: '/audit-logs' },
|
|
9
|
+
{ label: 'Careers', value: '/careers' },
|
|
10
|
+
{ label: 'PHD Applications', value: '/phd' },
|
|
11
|
+
{ label: 'Anurag CET', value: '/applications' },
|
|
12
|
+
{ label: 'Agri CET', value: '/agricet' },
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
const CogWheelMenu = () => {
|
|
16
|
+
const history = useHistory()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<MenuButton
|
|
20
|
+
anchor={
|
|
21
|
+
<IconButton color="secondary">
|
|
22
|
+
<SettingsOutlined />
|
|
23
|
+
</IconButton>
|
|
24
|
+
}
|
|
25
|
+
menu={profileMenu?.map((item) => ({
|
|
26
|
+
label: item?.label,
|
|
27
|
+
onClick: () => {
|
|
28
|
+
history.push(item?.value)
|
|
29
|
+
},
|
|
30
|
+
}))}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default CogWheelMenu
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HelpOutline } from '@mui/icons-material'
|
|
2
|
+
import { Button, IconButton } 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
|
+
|
|
14
|
+
return (
|
|
15
|
+
<IconButton color="secondary" onClick={handleOpenFreshDeskWidget}>
|
|
16
|
+
<HelpOutline />
|
|
17
|
+
</IconButton>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ExitToAppOutlined,
|
|
3
|
+
HttpsOutlined,
|
|
4
|
+
PermIdentityOutlined,
|
|
5
|
+
} from '@mui/icons-material'
|
|
6
|
+
import { Avatar, Typography } from '@mui/material'
|
|
7
|
+
import { useHistory } from '../../../hooks/useRouter'
|
|
8
|
+
import { avatarImage } from '../../../assets/images'
|
|
9
|
+
import { UserStore } from '../../../shared-state/UserStore'
|
|
10
|
+
import MenuButton from '../../MenuButton'
|
|
11
|
+
import { StyledUser } from './styles'
|
|
12
|
+
|
|
13
|
+
async function logout() {
|
|
14
|
+
localStorage.removeItem('token')
|
|
15
|
+
window.location.reload()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function UserBox() {
|
|
19
|
+
const user = UserStore.useState((s) => s).user
|
|
20
|
+
const history = useHistory()
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<MenuButton
|
|
24
|
+
anchor={
|
|
25
|
+
<StyledUser>
|
|
26
|
+
<Avatar src={user?.picture?.url ?? avatarImage} />
|
|
27
|
+
<Typography variant="h6">{user?.fullName}</Typography>
|
|
28
|
+
</StyledUser>
|
|
29
|
+
}
|
|
30
|
+
menu={[
|
|
31
|
+
{
|
|
32
|
+
label: 'Profile',
|
|
33
|
+
icon: <PermIdentityOutlined />,
|
|
34
|
+
onClick: () => {
|
|
35
|
+
history.push('/profile')
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Change Password',
|
|
40
|
+
icon: <HttpsOutlined />,
|
|
41
|
+
onClick: () => {},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Logout',
|
|
45
|
+
icon: <ExitToAppOutlined />,
|
|
46
|
+
onClick: logout,
|
|
47
|
+
},
|
|
48
|
+
]}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import GiteTwoToneIcon from '@mui/icons-material/GiteTwoTone'
|
|
2
|
+
import SchoolRoundedIcon from '@mui/icons-material/SchoolRounded'
|
|
3
|
+
import AssignmentRoundedIcon from '@mui/icons-material/AssignmentRounded'
|
|
4
|
+
import AccountBalanceWalletRoundedIcon from '@mui/icons-material/AccountBalanceWalletRounded'
|
|
5
|
+
import PersonRoundedIcon from '@mui/icons-material/PersonRounded'
|
|
6
|
+
|
|
7
|
+
export const applications = [
|
|
8
|
+
{
|
|
9
|
+
title: 'CollegeX',
|
|
10
|
+
path: '/college',
|
|
11
|
+
icon: <SchoolRoundedIcon />,
|
|
12
|
+
key: 'collegex',
|
|
13
|
+
description: 'Pack my box with five dozens liquor jugs',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
title: 'ExamX',
|
|
17
|
+
path: '/exams',
|
|
18
|
+
icon: <AssignmentRoundedIcon />,
|
|
19
|
+
description: 'Pack my box with five dozens liquor jugs',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'PayX',
|
|
23
|
+
path: '/payments',
|
|
24
|
+
icon: <AccountBalanceWalletRoundedIcon />,
|
|
25
|
+
description: 'Pack my box with five dozens liquor jugs',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: 'PeopleX',
|
|
29
|
+
path: '/people',
|
|
30
|
+
icon: <PersonRoundedIcon />,
|
|
31
|
+
description: 'Pack my box with five dozens liquor jugs',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: 'HostelX',
|
|
35
|
+
path: '/hostel',
|
|
36
|
+
icon: <GiteTwoToneIcon />,
|
|
37
|
+
description: 'Pack my box with five dozens liquor jugs',
|
|
38
|
+
},
|
|
39
|
+
]
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const AppsIcon = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
id="apps"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
width="24"
|
|
7
|
+
height="24"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
id="Path_15109"
|
|
12
|
+
data-name="Path 15109"
|
|
13
|
+
d="M7,0H4A4,4,0,0,0,0,4V7a4,4,0,0,0,4,4H7a4,4,0,0,0,4-4V4A4,4,0,0,0,7,0ZM9,7A2,2,0,0,1,7,9H4A2,2,0,0,1,2,7V4A2,2,0,0,1,4,2H7A2,2,0,0,1,9,4Z"
|
|
14
|
+
fill="#d4483e"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
id="Path_15110"
|
|
18
|
+
data-name="Path 15110"
|
|
19
|
+
d="M20,0H17a4,4,0,0,0-4,4V7a4,4,0,0,0,4,4h3a4,4,0,0,0,4-4V4A4,4,0,0,0,20,0Zm2,7a2,2,0,0,1-2,2H17a2,2,0,0,1-2-2V4a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2Z"
|
|
20
|
+
fill="#f8d759"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
id="Path_15111"
|
|
24
|
+
data-name="Path 15111"
|
|
25
|
+
d="M7,13H4a4,4,0,0,0-4,4v3a4,4,0,0,0,4,4H7a4,4,0,0,0,4-4V17A4,4,0,0,0,7,13Zm2,7a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V17a2,2,0,0,1,2-2H7a2,2,0,0,1,2,2Z"
|
|
26
|
+
fill="#88b053"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
id="Path_15112"
|
|
30
|
+
data-name="Path 15112"
|
|
31
|
+
d="M20,13H17a4,4,0,0,0-4,4v3a4,4,0,0,0,4,4h3a4,4,0,0,0,4-4V17A4,4,0,0,0,20,13Zm2,7a2,2,0,0,1-2,2H17a2,2,0,0,1-2-2V17a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2Z"
|
|
32
|
+
fill="#4baabe"
|
|
33
|
+
/>
|
|
34
|
+
</svg>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const NotificationIcon = () => {
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<svg
|
|
42
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
+
width="18.125"
|
|
44
|
+
height="20"
|
|
45
|
+
viewBox="0 0 18.125 20"
|
|
46
|
+
>
|
|
47
|
+
<path
|
|
48
|
+
id="bell_10_"
|
|
49
|
+
data-name="bell (10)"
|
|
50
|
+
d="M18.958,11.384l-1.583-5.7a7.767,7.767,0,0,0-15.064.395L1.085,11.595a4.166,4.166,0,0,0,4.067,5.07H6.08a4.166,4.166,0,0,0,8.166,0h.7a4.166,4.166,0,0,0,4.015-5.281Zm-8.795,6.948a2.5,2.5,0,0,1-2.346-1.666H12.51A2.5,2.5,0,0,1,10.163,18.332Zm6.771-4.32A2.481,2.481,0,0,1,14.944,15H5.152a2.5,2.5,0,0,1-2.44-3.042L3.937,6.444a6.1,6.1,0,0,1,11.832-.31l1.583,5.7a2.481,2.481,0,0,1-.418,2.181Z"
|
|
51
|
+
transform="translate(-0.986 -0.002)"
|
|
52
|
+
fill="#121212"
|
|
53
|
+
/>
|
|
54
|
+
</svg>
|
|
55
|
+
</>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AppHeader'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AppBar, Box, ListItemText, styled } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
export const StyledImageWrapper = styled('div')`
|
|
4
|
+
width: auto;
|
|
5
|
+
height: 24px;
|
|
6
|
+
& img {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
object-fit: contain;
|
|
10
|
+
}
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const StyledItemText = styled(ListItemText)(({ theme }) => ({
|
|
14
|
+
color: theme.palette.text.primary,
|
|
15
|
+
transition: '0.2s ease',
|
|
16
|
+
}))
|
|
17
|
+
|
|
18
|
+
export const StyledAppBar = styled(AppBar)(({ theme }) => ({
|
|
19
|
+
backgroundColor: 'white',
|
|
20
|
+
boxShadow: '0px 8px 28px rgb(136,136,136, 0.3)',
|
|
21
|
+
}))
|
|
22
|
+
|
|
23
|
+
export const StyledHeader = styled(Box)(({ theme }) => ({
|
|
24
|
+
boxShadow: '0px 2px 10px #0000001a',
|
|
25
|
+
// padding: '0 1rem',
|
|
26
|
+
backgroundColor: 'white',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
'& .actions': {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
gap: '14px',
|
|
34
|
+
},
|
|
35
|
+
}))
|
|
36
|
+
|
|
37
|
+
export const StyledUser = styled(Box)(({ theme }) => ({
|
|
38
|
+
cursor: 'pointer',
|
|
39
|
+
borderRadius: '5px',
|
|
40
|
+
transition: 'background 0.2s ease',
|
|
41
|
+
padding: '5px 10px',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
gap: '10px',
|
|
45
|
+
'&:hover': {
|
|
46
|
+
background: theme.palette.secondary.light,
|
|
47
|
+
},
|
|
48
|
+
}))
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BoxProps, styled, Box, LinearProgress } from '@mui/material'
|
|
2
|
+
import { globalStore } from '../../App'
|
|
3
|
+
|
|
4
|
+
export default function LinearIndeterminate() {
|
|
5
|
+
const loading = globalStore.useState((s) => s).loading
|
|
6
|
+
|
|
7
|
+
if (!loading) return null
|
|
8
|
+
return <StyledLinearProgress />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const StyledLinearProgress = styled((props: BoxProps) => (
|
|
12
|
+
<Box {...props}>
|
|
13
|
+
<LinearProgress
|
|
14
|
+
color={'inherit'}
|
|
15
|
+
sx={{
|
|
16
|
+
height: '3px',
|
|
17
|
+
}}
|
|
18
|
+
/>
|
|
19
|
+
</Box>
|
|
20
|
+
))(({ theme }) => ({
|
|
21
|
+
width: '100%',
|
|
22
|
+
position: 'fixed',
|
|
23
|
+
top: '64px',
|
|
24
|
+
left: 0,
|
|
25
|
+
zIndex: 400,
|
|
26
|
+
color: theme.palette.common.yellow,
|
|
27
|
+
}))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './LinearProgress'
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Delete } from '@mui/icons-material'
|
|
2
|
+
import { Box, IconButton, styled, Typography, Stack } from '@mui/material'
|
|
3
|
+
import Image from '../Image'
|
|
4
|
+
// import { Media } from 'components/UploadButton/UploadButton'
|
|
5
|
+
|
|
6
|
+
interface MediaRowProps {
|
|
7
|
+
list: any[]
|
|
8
|
+
onDelete?: (mediaKey: string) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function MediaRow({ list, onDelete }: MediaRowProps) {
|
|
12
|
+
console.log(list, 'list')
|
|
13
|
+
return (
|
|
14
|
+
<Box sx={{ display: 'flex', gap: '1rem', width: '100%', flexWrap: 'wrap' }}>
|
|
15
|
+
{list.map((item, index) => (
|
|
16
|
+
<>{rednerMediaCard(item, onDelete)}</>
|
|
17
|
+
))}
|
|
18
|
+
</Box>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const rednerMediaCard = (item: any, onDelete?: (mediaKey: string) => void) => {
|
|
23
|
+
switch (item?.type) {
|
|
24
|
+
case 'image':
|
|
25
|
+
return (
|
|
26
|
+
<StyledImageContainer>
|
|
27
|
+
<IconButton
|
|
28
|
+
size="small"
|
|
29
|
+
color="error"
|
|
30
|
+
onClick={() => {
|
|
31
|
+
onDelete(item?.key)
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<Delete fontSize="small" />
|
|
35
|
+
</IconButton>
|
|
36
|
+
<Image src={item?.url} height={120} width={150} alt={''} />
|
|
37
|
+
</StyledImageContainer>
|
|
38
|
+
)
|
|
39
|
+
case 'file':
|
|
40
|
+
return (
|
|
41
|
+
<Stack
|
|
42
|
+
direction={'row'}
|
|
43
|
+
alignItems="center"
|
|
44
|
+
justifyContent={'space-between'}
|
|
45
|
+
gap={'10px'}
|
|
46
|
+
>
|
|
47
|
+
<Typography>{item?.fileName}</Typography>
|
|
48
|
+
<IconButton color="error">
|
|
49
|
+
<Delete fontSize="small" />
|
|
50
|
+
</IconButton>
|
|
51
|
+
</Stack>
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
break
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const StyledImageContainer = styled(Box)(({ theme }) => ({
|
|
60
|
+
border: theme.borders.grayLight,
|
|
61
|
+
borderRadius: '10px',
|
|
62
|
+
padding: '0.7rem',
|
|
63
|
+
position: 'relative',
|
|
64
|
+
'& > button': {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
right: 0,
|
|
67
|
+
top: 0,
|
|
68
|
+
},
|
|
69
|
+
}))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MediaRow'
|