@campxdev/campx-web-utils 0.5.3 → 0.5.5

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@campxdev/campx-web-utils",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "peerDependencies": {
7
- "@campxdev/react-blueprint": ">=1.8.9",
7
+ "@campxdev/react-blueprint": ">=1.9.0",
8
8
  "@emotion/react": ">=^11.13.3",
9
9
  "@emotion/styled": ">=^11.13.0",
10
10
  "@mui/icons-material": ">=6.1.5",
@@ -14,7 +14,7 @@
14
14
  "react-redux": "=>9.1.2"
15
15
  },
16
16
  "dependencies": {
17
- "@campxdev/react-blueprint": "1.8.9",
17
+ "@campxdev/react-blueprint": "1.9.0",
18
18
  "@hookform/resolvers": "^3.9.0",
19
19
  "@mui/x-date-pickers": "^7.22.1",
20
20
  "axios": "^1.7.2",
@@ -8,7 +8,6 @@ import { ChangePasswordDialog } from '../../components/ChangePassword';
8
8
  import { axios } from '../../config/axios';
9
9
  import { ErrorBoundary } from '../../context/export';
10
10
  import HelpDocs from './components/HelpDocs';
11
- import { helpDocsConfig } from './components/helpDocsConfig';
12
11
 
13
12
  type Props = {
14
13
  actions?: ReactNode[];
@@ -21,6 +20,10 @@ type Props = {
21
20
  designation?: string;
22
21
  clientName?: string;
23
22
  institutionData?: any[];
23
+ helpDocsConfig?: Record<
24
+ string,
25
+ { actions: { name: string; onClick: () => void }[] }
26
+ >;
24
27
  };
25
28
 
26
29
  export const AppLayout: React.FC<Props> = ({
@@ -34,6 +37,7 @@ export const AppLayout: React.FC<Props> = ({
34
37
  userName = '',
35
38
  designation = '',
36
39
  clientName = '',
40
+ helpDocsConfig,
37
41
  }) => {
38
42
  const [collapsed, setCollapsed] = useState(true);
39
43
  const theme = useTheme();
@@ -57,7 +61,7 @@ export const AppLayout: React.FC<Props> = ({
57
61
  const pathSegments = fullPath.split('/').filter(Boolean);
58
62
  const actualPath = pathSegments.slice(1).join('/');
59
63
  const normalizedPath = actualPath.replace(/\/\d+/g, '/:id');
60
- const helpDocsActions = helpDocsConfig[`/${normalizedPath}`]?.actions || [];
64
+ const helpDocsActions = helpDocsConfig?.[`/${normalizedPath}`]?.actions || [];
61
65
 
62
66
  return (
63
67
  <AppLayoutContainer>
@@ -87,11 +91,14 @@ export const AppLayout: React.FC<Props> = ({
87
91
  profileSx: { width: 32, height: 32, fontSize: '12px' },
88
92
  })}
89
93
  />
90
- {helpDocsActions.length > 0 && <HelpDocs actions={helpDocsActions} />}
91
- <OuletContainer
92
- sx={{
93
- // backgroundColor: theme.palette.surface.paperBackground,
94
+ {helpDocsConfig && helpDocsActions.length > 0 && (
95
+ <HelpDocs actions={helpDocsActions} />
96
+ )}
94
97
 
98
+ <OutletContainer
99
+ sx={{
100
+ margin: '12px 0px 0px 0px',
101
+ backgroundColor: theme.palette.surface.paperBackground,
95
102
  ...mainContainerSx,
96
103
  }}
97
104
  onClick={() => {
@@ -101,7 +108,7 @@ export const AppLayout: React.FC<Props> = ({
101
108
  <Suspense fallback={<Spinner />}>
102
109
  <ErrorBoundary>{children}</ErrorBoundary>
103
110
  </Suspense>
104
- </OuletContainer>
111
+ </OutletContainer>
105
112
  </motion.div>
106
113
  </AppLayoutContainer>
107
114
  );
@@ -114,13 +121,17 @@ const AppLayoutContainer = styled(Stack)(({ theme }: { theme?: any }) => ({
114
121
  [theme.breakpoints.down('md')]: { flexWrap: 'wrap' },
115
122
  }));
116
123
 
117
- const OuletContainer = styled(Box)(({ theme }: { theme?: any }) => ({
124
+ const OutletContainer = styled(Box)(({ theme }: { theme?: any }) => ({
118
125
  borderRadius: '8px',
119
126
  height: 'calc(100vh - 96px)',
120
127
  overflowY: 'scroll',
121
128
  width: '100%',
122
129
 
123
- '&::-webkit-scrollbar': { width: '0.5em', height: '0.2em' },
130
+ '&::-webkit-scrollbar': {
131
+ width: '0.5em',
132
+ height: '0.2em',
133
+ backgroundColor: theme.palette.surface.defaultBackground,
134
+ },
124
135
 
125
136
  '&::-webkit-scrollbar-thumb': {
126
137
  backgroundColor: theme.palette.primary.light,
@@ -1,89 +0,0 @@
1
- export const helpDocsConfig: Record<
2
- string,
3
- { actions: { name: string; onClick: () => void }[] }
4
- > = {
5
- '/payments/exam-fees': {
6
- actions: [
7
- {
8
- name: 'Know how to collect exam fee',
9
- onClick: () =>
10
- window.open('https://docs.campx.in/Workflows/collect_fee/', '_blank'),
11
- },
12
- ],
13
- },
14
- '/payments/student-permissions': {
15
- actions: [
16
- {
17
- name: 'Know how to manage permissions',
18
- onClick: () =>
19
- window.open('https://docs.campx.in/Workflows/collect_fee/', '_blank'),
20
- },
21
- ],
22
- },
23
- '/exams/blocked-students': {
24
- actions: [
25
- {
26
- name: 'Know how to block students',
27
- onClick: () =>
28
- window.open('https://docs.campx.in/Workflows/collect_fee/', '_blank'),
29
- },
30
- ],
31
- },
32
- '/ums/settings/assessments/assessment-types': {
33
- actions: [
34
- {
35
- name: 'Know how to setup Assessment rules',
36
- onClick: () =>
37
- window.open(
38
- 'https://docs.campx.in/Workflows/assessment_rules/',
39
- '_blank',
40
- ),
41
- },
42
- ],
43
- },
44
- '/ums/settings/assessments/assessment-templates': {
45
- actions: [
46
- {
47
- name: 'Know how to setup Assessment rules',
48
- onClick: () =>
49
- window.open(
50
- 'https://docs.campx.in/Workflows/assessment_rules/',
51
- '_blank',
52
- ),
53
- },
54
- ],
55
- },
56
- '/ums/classrooms/:id/timetable': {
57
- actions: [
58
- {
59
- name: 'Know how to suspend a class',
60
- onClick: () =>
61
- window.open(
62
- 'https://docs.campx.in/Workflows/suspending-a-class/',
63
- '_blank',
64
- ),
65
- },
66
- ],
67
- },
68
-
69
- '/exams/examinations/:id/bundle-subjects': {
70
- actions: [
71
- {
72
- name: 'Learn about Scanning & Bundling',
73
- onClick: () =>
74
- window.open(
75
- 'https://docs.campx.in/Workflows/scanningbundling_booklets/',
76
- '_blank',
77
- ),
78
- },
79
- {
80
- name: 'Know how to upload digital booklets',
81
- onClick: () =>
82
- window.open(
83
- 'https://docs.campx.in/Workflows/digital_booklets/',
84
- '_blank',
85
- ),
86
- },
87
- ],
88
- },
89
- };