umwd-components 0.1.666 → 0.1.668

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,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.666",
3
+ "version": "0.1.668",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/src/index.js",
6
6
  "module": "dist/src/index.js",
@@ -40,13 +40,13 @@ export default function EnduserProfileDisplay({
40
40
  phone,
41
41
  company_address,
42
42
  business_credentials,
43
- editProfileUrl = "/dashboard/enduser/user/profile/edit",
43
+ editProfileUrl = "/dashboard/admin/user/profile/edit",
44
44
  completeEnough = false,
45
45
  } = data;
46
46
 
47
47
  const pathname = usePathname();
48
48
  // Check if the current path is for an enduser profile
49
- const isEnduser = pathname.includes("enduser/user/");
49
+ const isEnduser = pathname.includes("admin/user/");
50
50
 
51
51
  return (
52
52
  <Paper sx={{ p: 2 }}>
@@ -75,12 +75,6 @@ export default function EnduserProfileDisplay({
75
75
  </>
76
76
  )}
77
77
 
78
- {business_credentials ? (
79
- <BusinessCredentials data={business_credentials} />
80
- ) : (
81
- <Typography>Business credentials not available</Typography>
82
- )}
83
-
84
78
  <Divider />
85
79
 
86
80
  <Grid container spacing={2} sx={{ width: "100%" }}>
@@ -19,6 +19,9 @@ import { useSnackbar } from "../../../context/common/SnackbarContext";
19
19
  import React, { useEffect } from "react";
20
20
  import { EnduserProfileProps } from "../../../types/e-commerce/enduser/types";
21
21
  import { SxProps } from "@mui/material";
22
+ import EmailIcon from "@mui/icons-material/Email";
23
+ import PhoneIcon from "@mui/icons-material/Phone";
24
+ import PersonIcon from "@mui/icons-material/Person";
22
25
 
23
26
  const INITIAL_STATE = {
24
27
  zodErrors: null,
@@ -93,20 +96,33 @@ export default function EnduserProfileEditForm({
93
96
  </Grid>
94
97
 
95
98
  <Grid item xs={12}>
96
- <TextField
97
- id="email"
98
- name="email"
99
- label="Email"
100
- type="email"
101
- defaultValue={email}
102
- />
103
- <TextField
104
- id="phone"
105
- name="phone"
106
- label="Phone"
107
- type="tel"
108
- defaultValue={phone}
109
- />
99
+ <Stack spacing={2}>
100
+ <Typography variant="h6">Personal Information</Typography>
101
+ <Stack direction="row" alignItems="center">
102
+ <PersonIcon />
103
+ <Typography>{`${first_name} ${last_name}`}</Typography>
104
+ </Stack>
105
+ <Stack direction="row" alignItems="center">
106
+ <EmailIcon />
107
+ <TextField
108
+ id="email"
109
+ name="email"
110
+ label="Email"
111
+ type="email"
112
+ defaultValue={email}
113
+ />
114
+ </Stack>
115
+ <Stack direction="row" alignItems="center">
116
+ <PhoneIcon />
117
+ <TextField
118
+ id="phone"
119
+ name="phone"
120
+ label="Phone"
121
+ type="tel"
122
+ defaultValue={phone}
123
+ />
124
+ </Stack>
125
+ </Stack>
110
126
  </Grid>
111
127
 
112
128
  <Grid item xs={12}>
@@ -75,12 +75,6 @@ export default function DispatcherProfileDisplay({
75
75
  </>
76
76
  )}
77
77
 
78
- {business_credentials ? (
79
- <BusinessCredentials data={business_credentials} />
80
- ) : (
81
- <Typography>Business credentials not available</Typography>
82
- )}
83
-
84
78
  <Divider />
85
79
 
86
80
  <Grid container spacing={2} sx={{ width: "100%" }}>
@@ -19,6 +19,9 @@ import { useSnackbar } from "../../../context/common/SnackbarContext";
19
19
  import React, { useEffect } from "react";
20
20
  import { DispatcherProfileProps } from "../../../types/logistics/dispatcher/types";
21
21
  import { SxProps } from "@mui/material";
22
+ import EmailIcon from "@mui/icons-material/Email";
23
+ import PhoneIcon from "@mui/icons-material/Phone";
24
+ import PersonIcon from "@mui/icons-material/Person";
22
25
 
23
26
  const INITIAL_STATE = {
24
27
  zodErrors: null,
@@ -93,20 +96,33 @@ export default function DispatcherProfileEditForm({
93
96
  </Grid>
94
97
 
95
98
  <Grid item xs={12}>
96
- <TextField
97
- id="email"
98
- name="email"
99
- label="Email"
100
- type="email"
101
- defaultValue={email}
102
- />
103
- <TextField
104
- id="phone"
105
- name="phone"
106
- label="Phone"
107
- type="tel"
108
- defaultValue={phone}
109
- />
99
+ <Stack spacing={2}>
100
+ <Typography variant="h6">Personal Information</Typography>
101
+ <Stack direction="row" alignItems="center">
102
+ <PersonIcon />
103
+ <Typography>{`${first_name} ${last_name}`}</Typography>
104
+ </Stack>
105
+ <Stack direction="row" alignItems="center">
106
+ <EmailIcon />
107
+ <TextField
108
+ id="email"
109
+ name="email"
110
+ label="Email"
111
+ type="email"
112
+ defaultValue={email}
113
+ />
114
+ </Stack>
115
+ <Stack direction="row" alignItems="center">
116
+ <PhoneIcon />
117
+ <TextField
118
+ id="phone"
119
+ name="phone"
120
+ label="Phone"
121
+ type="tel"
122
+ defaultValue={phone}
123
+ />
124
+ </Stack>
125
+ </Stack>
110
126
  </Grid>
111
127
 
112
128
  <Grid item xs={12}>
@@ -34,7 +34,13 @@ export const SessionProvider = ({ children }: { children: ReactNode }) => {
34
34
  const [loading, setLoading] = useState<boolean>(true);
35
35
  const [error, setError] = useState<string | null>(null);
36
36
  const searchParams = useSearchParams();
37
- const { consentGiven } = useCookieConsent();
37
+ let consentGiven = true;
38
+ try {
39
+ const cookieConsent = useCookieConsent();
40
+ consentGiven = cookieConsent?.consentGiven ?? true;
41
+ } catch {
42
+ consentGiven = true;
43
+ }
38
44
 
39
45
  const fetchUser = async () => {
40
46
  setLoading(true);