umwd-components 0.1.700 → 0.1.701
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/src/components/e-commerce/customer/CustomerProfileDisplay.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/e-commerce/customer/CustomerProfileDisplay.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/e-commerce/customer/CustomerProfileDisplay.tsx +71 -36
|
@@ -7,6 +7,12 @@ interface CustomerProfileDisplayProps extends CustomerProfileProps {
|
|
|
7
7
|
editProfileUrl?: string;
|
|
8
8
|
completeEnough?: boolean;
|
|
9
9
|
}
|
|
10
|
+
/** INFO
|
|
11
|
+
* CustomerProfileDisplay is a component that displays customer profile information.
|
|
12
|
+
* This component is used in the frontend to display customer profile information
|
|
13
|
+
* but is also used to display user information in the admin panel.
|
|
14
|
+
* Only a logged in frontend customer role can edit their profile.
|
|
15
|
+
*/
|
|
10
16
|
export default function CustomerProfileDisplay({ data, }: {
|
|
11
17
|
readonly data: CustomerProfileDisplayProps;
|
|
12
18
|
}): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -35,6 +35,12 @@ interface CustomerProfileDisplayProps extends CustomerProfileProps {
|
|
|
35
35
|
completeEnough?: boolean;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** INFO
|
|
39
|
+
* CustomerProfileDisplay is a component that displays customer profile information.
|
|
40
|
+
* This component is used in the frontend to display customer profile information
|
|
41
|
+
* but is also used to display user information in the admin panel.
|
|
42
|
+
* Only a logged in frontend customer role can edit their profile.
|
|
43
|
+
*/
|
|
38
44
|
export default function CustomerProfileDisplay({
|
|
39
45
|
data,
|
|
40
46
|
}: {
|
|
@@ -81,24 +87,28 @@ export default function CustomerProfileDisplay({
|
|
|
81
87
|
</Typography>
|
|
82
88
|
)}
|
|
83
89
|
</Stack>
|
|
84
|
-
{isCustomer &&
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
{isCustomer && (
|
|
91
|
+
<>
|
|
92
|
+
{!Boolean(completeEnough) ? (
|
|
93
|
+
<Alert
|
|
94
|
+
severity="warning"
|
|
95
|
+
action={
|
|
96
|
+
<StyledLink href={editProfileUrl} target="_self">
|
|
97
|
+
<Button variant="contained">complete profile</Button>
|
|
98
|
+
</StyledLink>
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
After completion of your profile you can enjoy all the
|
|
102
|
+
benefits of your services.
|
|
103
|
+
</Alert>
|
|
104
|
+
) : (
|
|
105
|
+
<Stack direction={"row"} justifyContent={"flex-end"}>
|
|
106
|
+
<StyledLink href={editProfileUrl} target="_self">
|
|
107
|
+
<Button variant="contained">edit profile</Button>
|
|
108
|
+
</StyledLink>
|
|
109
|
+
</Stack>
|
|
110
|
+
)}
|
|
111
|
+
</>
|
|
102
112
|
)}
|
|
103
113
|
</Stack>
|
|
104
114
|
<Divider />
|
|
@@ -202,11 +212,25 @@ export default function CustomerProfileDisplay({
|
|
|
202
212
|
{order.total_incl_vat} {order.order_currency}
|
|
203
213
|
</TableCell>
|
|
204
214
|
<TableCell align="right">
|
|
205
|
-
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
215
|
+
{isCustomer ? (
|
|
216
|
+
<StyledLink
|
|
217
|
+
href={`/user/orders?selectedOrder=${order.id}`}
|
|
218
|
+
target="_self"
|
|
219
|
+
>
|
|
220
|
+
<Button variant="contained" size="small">
|
|
221
|
+
View
|
|
222
|
+
</Button>
|
|
223
|
+
</StyledLink>
|
|
224
|
+
) : (
|
|
225
|
+
<StyledLink
|
|
226
|
+
href={`/dashboard/admin/e-commerce/opos?selectedOrder=${order.id}`}
|
|
227
|
+
target="_self"
|
|
228
|
+
>
|
|
229
|
+
<Button variant="contained" size="small">
|
|
230
|
+
View
|
|
231
|
+
</Button>
|
|
232
|
+
</StyledLink>
|
|
233
|
+
)}
|
|
210
234
|
</TableCell>
|
|
211
235
|
</TableRow>
|
|
212
236
|
))}
|
|
@@ -241,23 +265,34 @@ export default function CustomerProfileDisplay({
|
|
|
241
265
|
</TableRow>
|
|
242
266
|
</TableHead>
|
|
243
267
|
<TableBody>
|
|
244
|
-
{returns.data.map((
|
|
268
|
+
{returns.data.map((iro, index) => (
|
|
245
269
|
<TableRow key={index}>
|
|
246
|
-
<TableCell>{
|
|
247
|
-
<TableCell>{
|
|
270
|
+
<TableCell>{iro.return_number}</TableCell>
|
|
271
|
+
<TableCell>{iro.rma_number}</TableCell>
|
|
248
272
|
<TableCell>
|
|
249
|
-
{new Date(
|
|
273
|
+
{new Date(iro.return_date).toLocaleDateString()}
|
|
250
274
|
</TableCell>
|
|
251
|
-
<TableCell>{
|
|
275
|
+
<TableCell>{iro.status}</TableCell>
|
|
252
276
|
<TableCell align="right">
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
277
|
+
{isCustomer ? (
|
|
278
|
+
<StyledLink
|
|
279
|
+
href={`/user/returns/selectedIro=${iro.id}`}
|
|
280
|
+
target="_self"
|
|
281
|
+
>
|
|
282
|
+
<Button variant="contained" size="small">
|
|
283
|
+
View
|
|
284
|
+
</Button>
|
|
285
|
+
</StyledLink>
|
|
286
|
+
) : (
|
|
287
|
+
<StyledLink
|
|
288
|
+
href={`/dashboard/admin/e-commerce/iros?selectedIro=${iro.id}`}
|
|
289
|
+
target="_self"
|
|
290
|
+
>
|
|
291
|
+
<Button variant="contained" size="small">
|
|
292
|
+
View
|
|
293
|
+
</Button>
|
|
294
|
+
</StyledLink>
|
|
295
|
+
)}
|
|
261
296
|
</TableCell>
|
|
262
297
|
</TableRow>
|
|
263
298
|
))}
|