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/dist/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/ieee754/index.js +1 -1
- package/dist/src/components/e-commerce/enduser/EnduserProfileDisplay.js +1 -1
- package/dist/src/components/e-commerce/enduser/EnduserProfileEditForm.js +1 -1
- package/dist/src/components/logistics/dispatcher/DispatcherProfileDisplay.js +1 -1
- package/dist/src/components/logistics/dispatcher/DispatcherProfileEditForm.js +1 -1
- package/dist/src/context/auth/SessionContext.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/e-commerce/enduser/EnduserProfileDisplay.tsx +2 -8
- package/src/components/e-commerce/enduser/EnduserProfileEditForm.tsx +30 -14
- package/src/components/logistics/dispatcher/DispatcherProfileDisplay.tsx +0 -6
- package/src/components/logistics/dispatcher/DispatcherProfileEditForm.tsx +30 -14
- package/src/context/auth/SessionContext.tsx +7 -1
package/package.json
CHANGED
|
@@ -40,13 +40,13 @@ export default function EnduserProfileDisplay({
|
|
|
40
40
|
phone,
|
|
41
41
|
company_address,
|
|
42
42
|
business_credentials,
|
|
43
|
-
editProfileUrl = "/dashboard/
|
|
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("
|
|
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
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
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);
|