@campxdev/campx-web-utils 0.3.6 → 0.3.8

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,19 +1,20 @@
1
1
  {
2
2
  "name": "@campxdev/campx-web-utils",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "peerDependencies": {
7
- "@campxdev/react-blueprint": ">=^1.5.8",
7
+ "@campxdev/react-blueprint": ">=^1.5.9",
8
8
  "@emotion/react": ">=^11.13.3",
9
9
  "@emotion/styled": ">=^11.13.0",
10
10
  "@mui/icons-material": ">=6.1.5",
11
11
  "@mui/material": ">=6.1.5",
12
12
  "@mui/x-data-grid": ">=7.22.1",
13
- "@mui/x-date-pickers": ">=7.22.1"
13
+ "@mui/x-date-pickers": ">=7.22.1",
14
+ "react-redux":"=>9.1.2"
14
15
  },
15
16
  "dependencies": {
16
- "@campxdev/react-blueprint": "1.5.8",
17
+ "@campxdev/react-blueprint": "1.5.9",
17
18
  "@hookform/resolvers": "^3.9.0",
18
19
  "@mui/x-date-pickers": "^7.22.1",
19
20
  "axios": "^1.7.2",
@@ -26,6 +27,7 @@
26
27
  "react-dom": "^18.3.1",
27
28
  "react-hook-form": "^7.52.1",
28
29
  "react-query": "^3.39.3",
30
+ "react-redux": "^9.1.2",
29
31
  "react-scripts": "5.0.1",
30
32
  "react-toastify": "^9.0.1",
31
33
  "typescript": "^5.5.2",
@@ -36,23 +38,23 @@
36
38
  "devDependencies": {
37
39
  "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
38
40
  "@craco/craco": "^7.1.0",
41
+ "@testing-library/jest-dom": "^5.14.1",
42
+ "@testing-library/react": "^13.0.0",
43
+ "@testing-library/user-event": "^13.2.1",
39
44
  "@types/babel__core": "^7.20.5",
40
45
  "@types/babel__generator": "^7.6.8",
41
46
  "@types/babel__template": "^7.4.4",
42
47
  "@types/babel__traverse": "^7.20.6",
43
48
  "@types/bonjour": "^3.5.13",
49
+ "@types/jest": "^27.0.1",
44
50
  "@types/js-cookie": "^3.0.2",
45
51
  "@types/lodash": "^4.17.5",
52
+ "@types/node": "^16.7.13",
46
53
  "@types/prettier": "^3.0.0",
47
54
  "@types/react": "^18.3.3",
48
55
  "@types/react-dom": "^18.3.0",
49
56
  "@types/react-query": "^1.2.9",
50
- "@types/react-router-dom": "^5.3.3",
51
- "@testing-library/jest-dom": "^5.14.1",
52
- "@testing-library/react": "^13.0.0",
53
- "@testing-library/user-event": "^13.2.1",
54
- "@types/jest": "^27.0.1",
55
- "@types/node": "^16.7.13"
57
+ "@types/react-router-dom": "^5.3.3"
56
58
  },
57
59
  "scripts": {
58
60
  "start": "craco start",
@@ -4,6 +4,7 @@ import { EmployeesSelector } from './selectors/EmployeesSelector';
4
4
 
5
5
  function AppContent() {
6
6
  const [value, setValue] = useState('63b810ee995d6d64f4a248de');
7
+
7
8
  return (
8
9
  <>
9
10
  <Button variant="contained" onClick={() => {}}>
@@ -1,9 +1,10 @@
1
- import { lightTheme, MuiThemeProvider } from '@campxdev/react-blueprint';
1
+ import { lightTheme, MuiThemeProvider, store } from '@campxdev/react-blueprint';
2
2
  import { LocalizationProvider } from '@mui/x-date-pickers';
3
3
  import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
4
4
  import Cookies from 'js-cookie';
5
5
  import { ReactNode, useEffect } from 'react';
6
6
  import { QueryClient, QueryClientProvider } from 'react-query';
7
+ import { Provider } from 'react-redux';
7
8
  import { BrowserRouter } from 'react-router-dom';
8
9
  import { ConfirmDialogProvider } from './ConfirmDialogProvider';
9
10
  import { SnackbarProvider } from './SnackbarProvider';
@@ -43,16 +44,18 @@ export const Providers = ({
43
44
  }, [institutionCode, tenantCode]);
44
45
 
45
46
  return (
46
- <BrowserRouter basename={basename ?? baseName}>
47
- <QueryClientProvider client={queryClient}>
48
- <MuiThemeProvider theme={theme}>
49
- <SnackbarProvider>
50
- <LocalizationProvider dateAdapter={AdapterDateFns}>
51
- <ConfirmDialogProvider>{children}</ConfirmDialogProvider>
52
- </LocalizationProvider>
53
- </SnackbarProvider>
54
- </MuiThemeProvider>
55
- </QueryClientProvider>
56
- </BrowserRouter>
47
+ <Provider store={store}>
48
+ <BrowserRouter basename={basename ?? baseName}>
49
+ <QueryClientProvider client={queryClient}>
50
+ <MuiThemeProvider theme={theme}>
51
+ <SnackbarProvider>
52
+ <LocalizationProvider dateAdapter={AdapterDateFns}>
53
+ <ConfirmDialogProvider>{children}</ConfirmDialogProvider>
54
+ </LocalizationProvider>
55
+ </SnackbarProvider>
56
+ </MuiThemeProvider>
57
+ </QueryClientProvider>
58
+ </BrowserRouter>
59
+ </Provider>
57
60
  );
58
61
  };
@@ -5,13 +5,15 @@ import { motion } from 'framer-motion';
5
5
  import Cookies from 'js-cookie';
6
6
  import { Suspense, useState } from 'react';
7
7
  import { axios } from '../config/axios';
8
- import { ApplicationStore, ErrorBoundary } from '../context/export';
8
+ import { ErrorBoundary } from '../context/export';
9
9
 
10
10
  interface Props {
11
11
  children?: React.ReactNode;
12
12
  menu: SideMenuItemProps[];
13
13
  mainContainerSx?: any;
14
14
  handleLogout?: any;
15
+ userName?: string;
16
+ designation?: string;
15
17
  }
16
18
 
17
19
  export const AppLayout: React.FC<Props> = ({
@@ -19,12 +21,12 @@ export const AppLayout: React.FC<Props> = ({
19
21
  menu,
20
22
  mainContainerSx,
21
23
  handleLogout,
24
+ userName = '',
25
+ designation = '',
22
26
  }) => {
23
27
  const [collapsed, setCollapsed] = useState(true);
24
28
  const theme = useTheme();
25
29
 
26
- const user = ApplicationStore.useState((s) => s.user);
27
-
28
30
  function logout() {
29
31
  axios
30
32
  .post('/auth-server/auth/logout')
@@ -62,8 +64,8 @@ export const AppLayout: React.FC<Props> = ({
62
64
  showActiveDevices={false}
63
65
  onLogoutClick={handleLogout ?? logout}
64
66
  clientName={''}
65
- userFullName={user ? user?.fullName : ''}
66
- designation={user?.email}
67
+ userFullName={userName}
68
+ designation={designation}
67
69
  />
68
70
  <Box
69
71
  sx={{