|
@@ -8,6 +8,8 @@ import {
|
8
|
8
|
RadioGroup,
|
9
|
9
|
FormControlLabel,
|
10
|
10
|
Radio,
|
|
11
|
+ Link,
|
|
12
|
+ Checkbox
|
11
|
13
|
} from '@mui/material';
|
12
|
14
|
import Table from '@mui/material/Table';
|
13
|
15
|
import TableBody from '@mui/material/TableBody';
|
|
@@ -16,6 +18,9 @@ import TableContainer from '@mui/material/TableContainer';
|
16
|
18
|
import TableHead from '@mui/material/TableHead';
|
17
|
19
|
import TableRow from '@mui/material/TableRow';
|
18
|
20
|
import Grid from '@mui/material/Grid2';
|
|
21
|
+import CreditCardIcon from '@mui/icons-material/CreditCard';
|
|
22
|
+import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet';
|
|
23
|
+
|
19
|
24
|
|
20
|
25
|
const BillingForm = () => {
|
21
|
26
|
|
|
@@ -49,94 +54,343 @@ const BillingForm = () => {
|
49
|
54
|
|
50
|
55
|
return (
|
51
|
56
|
<Box
|
52
|
|
-
|
|
57
|
+
|
53
|
58
|
onSubmit={handleSubmit}
|
54
|
59
|
sx={{
|
55
|
60
|
width: '100%',
|
56
|
61
|
}}
|
57
|
62
|
>
|
58
|
|
-
|
59
|
|
- {/* Product List */}
|
|
63
|
+
|
|
64
|
+ {/* Product TableList */}
|
|
65
|
+ <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>1. YOUR ORDER SUMMARY</Typography>
|
|
66
|
+
|
60
|
67
|
<TableContainer>
|
61
|
|
- <Table sx={{ minWidth: 650, mb: 5, backgroundColor:"#F7FBFF" }}>
|
62
|
|
- <TableHead>
|
63
|
|
- <TableRow>
|
64
|
|
- <TableCell width={150}>
|
65
|
|
- <Typography variant='body1'>Item</Typography>
|
|
68
|
+ <Table sx={{ minWidth: 650, backgroundColor: "#F7FBFF" }}>
|
|
69
|
+ <TableHead>
|
|
70
|
+ <TableRow>
|
|
71
|
+ <TableCell width={150}>
|
|
72
|
+ <Typography variant='body1'>Item</Typography>
|
|
73
|
+ </TableCell>
|
|
74
|
+ <TableCell width={150}>
|
|
75
|
+ {/* This is just for table offset */}
|
|
76
|
+ <Typography variant='body1'></Typography>
|
|
77
|
+ </TableCell>
|
|
78
|
+ <TableCell align='center'>
|
|
79
|
+ <Typography variant='body1'>Colour</Typography>
|
|
80
|
+ </TableCell>
|
|
81
|
+ <TableCell align='center'>
|
|
82
|
+
|
|
83
|
+ <Typography variant='body1'>Quantity</Typography>
|
|
84
|
+ </TableCell>
|
|
85
|
+ <TableCell align='center'>
|
|
86
|
+ <Typography variant='body1'>Unit Price</Typography>
|
|
87
|
+ </TableCell>
|
|
88
|
+ <TableCell align='center'>
|
|
89
|
+ <Typography variant='body1'>Shipping</Typography>
|
|
90
|
+ </TableCell>
|
|
91
|
+ <TableCell align='center'>
|
|
92
|
+ <Typography variant='body1'>Tax</Typography>
|
|
93
|
+ </TableCell>
|
|
94
|
+ <TableCell align='center'>
|
|
95
|
+ <Typography variant='body1'>Duties</Typography>
|
|
96
|
+ </TableCell>
|
|
97
|
+ </TableRow>
|
|
98
|
+ </TableHead>
|
|
99
|
+ <TableBody>
|
|
100
|
+ {rows.map((row) => (
|
|
101
|
+ <TableRow
|
|
102
|
+ key={row.id}
|
|
103
|
+ sx={{
|
|
104
|
+ '& td, & th': { border: 0 },
|
|
105
|
+ '&:last-child td, &:last-child th': { border: 0 }
|
|
106
|
+ }}
|
|
107
|
+ >
|
|
108
|
+ <TableCell component="th" scope="row">
|
|
109
|
+ <img
|
|
110
|
+ src={row.img_src}
|
|
111
|
+ alt={row.img_src}
|
|
112
|
+ style={{
|
|
113
|
+ width: 100,
|
|
114
|
+ height: 100,
|
|
115
|
+ aspectRatio: '4 / 4',
|
|
116
|
+ objectFit: 'cover',
|
|
117
|
+ }}
|
|
118
|
+ />
|
66
|
119
|
</TableCell>
|
67
|
|
- <TableCell width={150}>
|
68
|
|
- {/* This is just for table offset */}
|
69
|
|
- <Typography variant='body1'></Typography>
|
|
120
|
+ <TableCell>
|
|
121
|
+ <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
|
|
122
|
+ <Typography variant='body2'>{row.description}</Typography>
|
70
|
123
|
</TableCell>
|
71
|
124
|
<TableCell align='center'>
|
72
|
|
- <Typography variant='body1'>Colour</Typography>
|
|
125
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
|
73
|
126
|
</TableCell>
|
74
|
127
|
<TableCell align='center'>
|
75
|
|
-
|
76
|
|
- <Typography variant='body1'>Quantity</Typography>
|
|
128
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{row.quantity}</Typography>
|
77
|
129
|
</TableCell>
|
78
|
130
|
<TableCell align='center'>
|
79
|
|
- <Typography variant='body1'>Unit Price</Typography>
|
|
131
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
80
|
132
|
</TableCell>
|
81
|
133
|
<TableCell align='center'>
|
82
|
|
- <Typography variant='body1'>Shipping</Typography>
|
|
134
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
83
|
135
|
</TableCell>
|
84
|
136
|
<TableCell align='center'>
|
85
|
|
- <Typography variant='body1'>Tax</Typography>
|
|
137
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
86
|
138
|
</TableCell>
|
87
|
139
|
<TableCell align='center'>
|
88
|
|
- <Typography variant='body1'>Duties</Typography>
|
|
140
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
89
|
141
|
</TableCell>
|
90
|
142
|
</TableRow>
|
91
|
|
- </TableHead>
|
92
|
|
- <TableBody>
|
93
|
|
- {rows.map((row) => (
|
94
|
|
- <TableRow
|
95
|
|
- key={row.id}
|
|
143
|
+ ))}
|
|
144
|
+ </TableBody>
|
|
145
|
+ </Table>
|
|
146
|
+ <Box sx={{
|
|
147
|
+ backgroundColor: "#F7FBFF",
|
|
148
|
+ borderTop: "1px solid rgba(0,0,0,0.1)",
|
|
149
|
+ borderBottom: "1px solid rgba(0,0,0,0.1)",
|
|
150
|
+ pl: 2,
|
|
151
|
+ pr: 6,
|
|
152
|
+ py: 2,
|
|
153
|
+ mb: 5,
|
|
154
|
+ display: "flex",
|
|
155
|
+ justifyContent: "space-between"
|
|
156
|
+
|
|
157
|
+ }}>
|
|
158
|
+ <Link variant='body2' sx={{ textDecoration: "underline", color: "#000", fontWeight: "200", letterSpacing: 1 }}>ADD A GIFT CARD OR PROMOTION CODE</Link>
|
|
159
|
+ <Typography variant='body2'> Total <span style={{ fontWeight: "bold" }}>{`RM ${parseFloat(250).toFixed(2)}`}</span> </Typography>
|
|
160
|
+ </Box>
|
|
161
|
+ </TableContainer>
|
|
162
|
+
|
|
163
|
+ {/* Shipping Data */}
|
|
164
|
+ <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>2. REVIEW SHIPPING AND BILLING ADDRESS</Typography>
|
|
165
|
+ <Grid container sx={{
|
|
166
|
+ backgroundColor: "#F7FBFF",
|
|
167
|
+ borderTop: "1px solid rgba(0,0,0,0.1)",
|
|
168
|
+ borderBottom: "1px solid rgba(0,0,0,0.1)",
|
|
169
|
+ p: 2,
|
|
170
|
+ mb: 10
|
|
171
|
+ }}>
|
|
172
|
+ <Grid size={6}>
|
|
173
|
+ <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>SHIPPING ADDRESS</Typography>
|
|
174
|
+ <Box sx={{ display: "flex", flexDirection: "column" }}>
|
|
175
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Mr. David Olson</Typography>
|
|
176
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>4220 Raintree Boulevard</Typography>
|
|
177
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Montezuma</Typography>
|
|
178
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Indiana</Typography>
|
|
179
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>47862</Typography>
|
|
180
|
+ <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>USA</Typography>
|
|
181
|
+ <Link sx={{ color: "black", textDecoration: "underline", fontSize: 15 }}>CHANGE SHIPPING ADDRESS</Link>
|
|
182
|
+ </Box>
|
|
183
|
+ </Grid>
|
|
184
|
+ <Grid size={6}>
|
|
185
|
+ <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>BILLING ADDRESS</Typography>
|
|
186
|
+ <Box sx={{ display: "flex", flexDirection: "column" }}>
|
|
187
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Mr. David Olson</Typography>
|
|
188
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>4220 Raintree Boulevard</Typography>
|
|
189
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Montezuma</Typography>
|
|
190
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Indiana</Typography>
|
|
191
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>47862</Typography>
|
|
192
|
+ <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>USA</Typography>
|
|
193
|
+ <Link sx={{ color: "black", textDecoration: "underline", fontSize: 15 }}>CHANGE SHIPPING ADDRESS</Link>
|
|
194
|
+ </Box>
|
|
195
|
+ </Grid>
|
|
196
|
+ </Grid>
|
|
197
|
+
|
|
198
|
+ {/* Delivery Data */}
|
|
199
|
+ <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>3. DELIVERY METHOD</Typography>
|
|
200
|
+ <Grid container sx={{
|
|
201
|
+ backgroundColor: "#F7FBFF",
|
|
202
|
+ borderTop: "1px solid rgba(0,0,0,0.1)",
|
|
203
|
+ borderBottom: "1px solid rgba(0,0,0,0.1)",
|
|
204
|
+ p: 2,
|
|
205
|
+ mb: 10
|
|
206
|
+ }}>
|
|
207
|
+ <Grid size={6}>
|
|
208
|
+ <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>EXPRESS DELIVERY (Free)</Typography>
|
|
209
|
+ <Box sx={{ display: "flex", flexDirection: "column" }}>
|
|
210
|
+ <Typography variant="body2" sx={{ fontWeight: "400" }}>Delivered in 3-4 business days</Typography>
|
|
211
|
+ </Box>
|
|
212
|
+ </Grid>
|
|
213
|
+ <Grid size={6}>
|
|
214
|
+ <Typography variant="body2" sx={{ fontWeight: "bold", mb: 5 }}>BILLING ADDRESS</Typography>
|
|
215
|
+ <Box sx={{ display: "flex", flexDirection: "column" }}>
|
|
216
|
+ <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>Caibre Premium Packaging</Typography>
|
|
217
|
+ <Link sx={{ color: "black", textDecoration: "underline", fontSize: 15 }}>GIFT MESSAGE & PERSONALISED LABELS AVAILABLE</Link>
|
|
218
|
+ </Box>
|
|
219
|
+ </Grid>
|
|
220
|
+ </Grid>
|
|
221
|
+
|
|
222
|
+ {/* PAYMENT Data */}
|
|
223
|
+ <Typography variant='body1' sx={{ fontWeight: "500", my: 5 }}>4. PAYMENT DETAILS</Typography>
|
|
224
|
+ <Grid container sx={{
|
|
225
|
+ backgroundColor: "#F7FBFF",
|
|
226
|
+ borderTop: "1px solid rgba(0,0,0,0.1)",
|
|
227
|
+ borderBottom: "1px solid rgba(0,0,0,0.1)",
|
|
228
|
+ p: 2,
|
|
229
|
+ mb: 5
|
|
230
|
+ }}>
|
|
231
|
+ <Grid size={6}>
|
|
232
|
+ <Typography variant="body2" sx={{ fontWeight: "400", mb: 5 }}>PAYMENT METHOD</Typography>
|
|
233
|
+ <Grid container spacing={2}>
|
|
234
|
+
|
|
235
|
+ {/* PAYMENT METHOD */}
|
|
236
|
+ <Grid item size={12}>
|
|
237
|
+ <Box>
|
|
238
|
+ <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
|
|
239
|
+ PAYMENT METHOD
|
|
240
|
+ </Typography>
|
|
241
|
+ <RadioGroup row>
|
|
242
|
+ <FormControlLabel
|
|
243
|
+ value="credit"
|
|
244
|
+ control={<Radio />}
|
|
245
|
+ label={
|
|
246
|
+ <Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
|
247
|
+ <CreditCardIcon />
|
|
248
|
+ </Box>
|
|
249
|
+ }
|
|
250
|
+ />
|
|
251
|
+ <FormControlLabel
|
|
252
|
+ value="wallet"
|
|
253
|
+ control={<Radio />}
|
|
254
|
+ label={
|
|
255
|
+ <Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
|
256
|
+ <AccountBalanceWalletIcon />
|
|
257
|
+ </Box>
|
|
258
|
+ }
|
|
259
|
+ />
|
|
260
|
+ </RadioGroup>
|
|
261
|
+ </Box>
|
|
262
|
+ </Grid>
|
|
263
|
+
|
|
264
|
+ {/* Cardholder Name Input */}
|
|
265
|
+ <Grid item size={12}>
|
|
266
|
+ <Box>
|
|
267
|
+ <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
|
|
268
|
+ CARDHOLDER NAME
|
|
269
|
+ </Typography>
|
|
270
|
+ <TextField
|
|
271
|
+ variant="outlined"
|
|
272
|
+ sx={{
|
|
273
|
+ width: "100%",
|
|
274
|
+ backgroundColor: "#FFF",
|
|
275
|
+ }}
|
|
276
|
+ />
|
|
277
|
+ </Box>
|
|
278
|
+ </Grid>
|
|
279
|
+
|
|
280
|
+ {/* Card Number Input */}
|
|
281
|
+ <Grid item size={12}>
|
|
282
|
+ <Box>
|
|
283
|
+ <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
|
|
284
|
+ CARD NUMBER
|
|
285
|
+ </Typography>
|
|
286
|
+ <Box
|
96
|
287
|
sx={{
|
97
|
|
- '& td, & th': { border: 0 },
|
98
|
|
- '&:last-child td, &:last-child th': { border: 0 }
|
|
288
|
+ display: "flex",
|
|
289
|
+ flexDirection: "row",
|
|
290
|
+ gap: 1,
|
99
|
291
|
}}
|
100
|
292
|
>
|
101
|
|
- <TableCell component="th" scope="row">
|
102
|
|
- <img
|
103
|
|
- src={row.img_src}
|
104
|
|
- alt={row.img_src}
|
105
|
|
- style={{
|
106
|
|
- width: 100,
|
107
|
|
- height: 100,
|
108
|
|
- aspectRatio: '4 / 4',
|
109
|
|
- objectFit: 'cover',
|
|
293
|
+ {[...Array(4)].map((_, index) => (
|
|
294
|
+ <TextField
|
|
295
|
+ key={index}
|
|
296
|
+ variant="outlined"
|
|
297
|
+ inputProps={{ maxLength: 4 }}
|
|
298
|
+ sx={{
|
|
299
|
+ width: "100px",
|
|
300
|
+ backgroundColor: "#FFF",
|
|
301
|
+ textAlign: "center",
|
110
|
302
|
}}
|
111
|
303
|
/>
|
112
|
|
- </TableCell>
|
113
|
|
- <TableCell>
|
114
|
|
- <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
|
115
|
|
- <Typography variant='body2'>{row.description}</Typography>
|
116
|
|
- </TableCell>
|
117
|
|
- <TableCell align='center'>
|
118
|
|
- <Typography variant='body1' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
|
119
|
|
- </TableCell>
|
120
|
|
- <TableCell align='center'>
|
121
|
|
- <Typography variant='body1' sx={{ fontWeight: "bold" }}>{row.quantity}</Typography>
|
122
|
|
- </TableCell>
|
123
|
|
- <TableCell align='center'>
|
124
|
|
- <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
125
|
|
- </TableCell>
|
126
|
|
- <TableCell align='center'>
|
127
|
|
- <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
128
|
|
- </TableCell>
|
129
|
|
- <TableCell align='center'>
|
130
|
|
- <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
131
|
|
- </TableCell>
|
132
|
|
- <TableCell align='center'>
|
133
|
|
- <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
134
|
|
- </TableCell>
|
135
|
|
- </TableRow>
|
136
|
|
- ))}
|
137
|
|
- </TableBody>
|
138
|
|
- </Table>
|
139
|
|
- </TableContainer>
|
|
304
|
+ ))}
|
|
305
|
+ </Box>
|
|
306
|
+ </Box>
|
|
307
|
+ </Grid>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+ {/* Expiration Date Input */}
|
|
313
|
+ <Grid item size={12}>
|
|
314
|
+ <Box>
|
|
315
|
+ <Typography variant="body2" sx={{ fontWeight: "500", mb: 2 }}>
|
|
316
|
+ EXPIRATION DATE
|
|
317
|
+ </Typography>
|
|
318
|
+ <Box>
|
|
319
|
+ <Grid container spacing={2}>
|
|
320
|
+ <Grid item size={6}>
|
|
321
|
+ <TextField
|
|
322
|
+ select
|
|
323
|
+ fullWidth
|
|
324
|
+ variant="outlined"
|
|
325
|
+ defaultValue={1}
|
|
326
|
+ sx={{ backgroundColor: "#FFF" }}
|
|
327
|
+ >
|
|
328
|
+ {[...Array(12)].map((_, index) => (
|
|
329
|
+ <MenuItem key={index} value={index + 1}>
|
|
330
|
+ {index + 1}
|
|
331
|
+ </MenuItem>
|
|
332
|
+ ))}
|
|
333
|
+ </TextField>
|
|
334
|
+ </Grid>
|
|
335
|
+ <Grid item size={3}>
|
|
336
|
+ <TextField
|
|
337
|
+ select
|
|
338
|
+ fullWidth
|
|
339
|
+ variant="outlined"
|
|
340
|
+ defaultValue={2023}
|
|
341
|
+ sx={{ backgroundColor: "#FFF" }}
|
|
342
|
+ >
|
|
343
|
+ {[...Array(10)].map((_, index) => (
|
|
344
|
+ <MenuItem key={index} value={2023 + index}>
|
|
345
|
+ {2023 + index}
|
|
346
|
+ </MenuItem>
|
|
347
|
+ ))}
|
|
348
|
+ </TextField>
|
|
349
|
+ </Grid>
|
|
350
|
+ <Grid item size={3}>
|
|
351
|
+ <TextField
|
|
352
|
+ variant="outlined"
|
|
353
|
+ inputProps={{ maxLength: 4 }}
|
|
354
|
+ sx={{ backgroundColor: "#FFF" }}
|
|
355
|
+ />
|
|
356
|
+ </Grid>
|
|
357
|
+ </Grid>
|
|
358
|
+ </Box>
|
|
359
|
+ </Box>
|
|
360
|
+ </Grid>
|
|
361
|
+
|
|
362
|
+ {/* Securely Store Payment Details */}
|
|
363
|
+ <Grid item size={12}>
|
|
364
|
+ <Box>
|
|
365
|
+ <FormControlLabel
|
|
366
|
+ control={<Checkbox />}
|
|
367
|
+ label="Securely store payment details for next purchase."
|
|
368
|
+ />
|
|
369
|
+ </Box>
|
|
370
|
+ </Grid>
|
|
371
|
+
|
|
372
|
+ </Grid>
|
|
373
|
+ </Grid>
|
|
374
|
+ </Grid>
|
|
375
|
+
|
|
376
|
+ <Box sx={{display:"flex", flexDirection:"row"}}>
|
|
377
|
+ <Button
|
|
378
|
+ variant="contained"
|
|
379
|
+ color="common.black"
|
|
380
|
+ onClick={() => { window.location.href = "/checkout" }}
|
|
381
|
+ sx={{
|
|
382
|
+ backgroundColor: (theme) => theme.palette.common.black,
|
|
383
|
+ color: "white",
|
|
384
|
+ textTransform: "none",
|
|
385
|
+ ml: "auto",
|
|
386
|
+ px: 8,
|
|
387
|
+ py: 2,
|
|
388
|
+ width: "fit-content",
|
|
389
|
+ "&:hover": {
|
|
390
|
+ backgroundColor: (theme) => theme.palette.grey[900],
|
|
391
|
+ },
|
|
392
|
+ }}>CONFIRM PURCHASE</Button>
|
|
393
|
+ </Box>
|
140
|
394
|
|
141
|
395
|
</Box>
|
142
|
396
|
);
|