|
@@ -1,8 +1,206 @@
|
1
|
1
|
import React from 'react'
|
|
2
|
+import { Box, Button, IconButton } from '@mui/material'
|
|
3
|
+import SocialMedia from '../components/SocialMedia'
|
|
4
|
+import Feature from '../components/Feature'
|
|
5
|
+import Grid from '@mui/material/Grid2';
|
|
6
|
+import Typography from '@mui/material/Typography';
|
|
7
|
+import Table from '@mui/material/Table';
|
|
8
|
+import TableBody from '@mui/material/TableBody';
|
|
9
|
+import TableCell from '@mui/material/TableCell';
|
|
10
|
+import TableContainer from '@mui/material/TableContainer';
|
|
11
|
+import TableHead from '@mui/material/TableHead';
|
|
12
|
+import TableRow from '@mui/material/TableRow';
|
|
13
|
+import AddIcon from '@mui/icons-material/Add';
|
|
14
|
+import RemoveIcon from '@mui/icons-material/Remove';
|
2
|
15
|
|
3
|
16
|
const Cart = () => {
|
|
17
|
+
|
|
18
|
+ function createData(img_src, description, colour, quantity, price) {
|
|
19
|
+ return { img_src, description, colour, quantity, price };
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+ const rows = [
|
|
23
|
+ {
|
|
24
|
+ img_src: 'https://via.placeholder.com/300',
|
|
25
|
+ name: 'MELUR',
|
|
26
|
+ description: 'Atma Sari New Raya Collection 2024',
|
|
27
|
+ colour: 'black',
|
|
28
|
+ quantity: 1,
|
|
29
|
+ price: 335.50
|
|
30
|
+ },
|
|
31
|
+ {
|
|
32
|
+ img_src: 'https://via.placeholder.com/300',
|
|
33
|
+ name: 'MELUR2',
|
|
34
|
+ description: 'Atma Sari New Raya Collection 2025',
|
|
35
|
+ colour: 'red',
|
|
36
|
+ quantity: 2,
|
|
37
|
+ price: 665.00
|
|
38
|
+ },
|
|
39
|
+ ];
|
|
40
|
+
|
4
|
41
|
return (
|
5
|
|
- <div>Cart</div>
|
|
42
|
+ <>
|
|
43
|
+ <Box sx={{ px: 24, my: 10 }}>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+ {/* Header */}
|
|
47
|
+ <Grid container spacing={2} alignItems="center" sx={{ mb: 5 }}>
|
|
48
|
+
|
|
49
|
+ {/* Type */}
|
|
50
|
+ <Grid item size={2}>
|
|
51
|
+ <Typography variant="body2">
|
|
52
|
+ <p>Mens Fashion <span style={{ fontWeight: "bold", marginLeft: 10, display: "inline-block" }}>Shopping Bag</span></p>
|
|
53
|
+ </Typography>
|
|
54
|
+ </Grid>
|
|
55
|
+
|
|
56
|
+ <Grid item size={4} offset={{ xs: 3 }}>
|
|
57
|
+ <Typography variant="h5" sx={{ fontWeight: "bold" }}>
|
|
58
|
+ SHOPPING BAG
|
|
59
|
+ </Typography>
|
|
60
|
+ </Grid>
|
|
61
|
+
|
|
62
|
+ </Grid>
|
|
63
|
+
|
|
64
|
+ {/* Product List */}
|
|
65
|
+ <TableContainer>
|
|
66
|
+ <Table sx={{ minWidth: 650, borderTop: "1px solid rgba(0,0,0,0.4)", borderBottom: "1px solid rgba(0,0,0,0.4)", mb: 5 }}>
|
|
67
|
+ <TableHead>
|
|
68
|
+ <TableRow>
|
|
69
|
+ <TableCell width={150}>
|
|
70
|
+ <Typography variant='body1'>Item</Typography>
|
|
71
|
+ </TableCell>
|
|
72
|
+ <TableCell>
|
|
73
|
+ <Typography variant='body1'>Description</Typography>
|
|
74
|
+ </TableCell>
|
|
75
|
+ <TableCell align='center'>
|
|
76
|
+ <Typography variant='body1'>Colour</Typography>
|
|
77
|
+ </TableCell>
|
|
78
|
+ <TableCell align='center'>
|
|
79
|
+
|
|
80
|
+ <Typography variant='body1'>Quantity</Typography>
|
|
81
|
+ </TableCell>
|
|
82
|
+ <TableCell align='center'>
|
|
83
|
+ <Typography variant='body1'>Unit Price</Typography>
|
|
84
|
+ </TableCell>
|
|
85
|
+ </TableRow>
|
|
86
|
+ </TableHead>
|
|
87
|
+ <TableBody>
|
|
88
|
+ {rows.map((row) => (
|
|
89
|
+ <TableRow
|
|
90
|
+ key={row.id}
|
|
91
|
+ sx={{
|
|
92
|
+ '& td, & th': { border: 0 },
|
|
93
|
+ '&:last-child td, &:last-child th': { border: 0 }
|
|
94
|
+ }}
|
|
95
|
+ >
|
|
96
|
+ <TableCell component="th" scope="row">
|
|
97
|
+ <img
|
|
98
|
+ src={row.img_src}
|
|
99
|
+ alt={row.img_src}
|
|
100
|
+ style={{
|
|
101
|
+ width: 100,
|
|
102
|
+ height: 100,
|
|
103
|
+ aspectRatio: '4 / 4',
|
|
104
|
+ objectFit: 'cover',
|
|
105
|
+ }}
|
|
106
|
+ />
|
|
107
|
+ </TableCell>
|
|
108
|
+ <TableCell>
|
|
109
|
+ <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
|
|
110
|
+ <Typography variant='body2'>{row.description}</Typography>
|
|
111
|
+ </TableCell>
|
|
112
|
+ <TableCell align='center'>
|
|
113
|
+ <Typography variant='h6' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
|
|
114
|
+ </TableCell>
|
|
115
|
+ <TableCell align='center'>
|
|
116
|
+ <Box sx={{ display: "flex", justifyContent: "center" }}>
|
|
117
|
+ <IconButton>
|
|
118
|
+ <RemoveIcon sx={{ fontSize: 16, margin: "0 15px" }} />
|
|
119
|
+ </IconButton>
|
|
120
|
+ <p style={{ fontSize: 20, fontWeight: "bold" }}>{row.quantity}</p>
|
|
121
|
+ <IconButton >
|
|
122
|
+ <AddIcon sx={{ fontSize: 16, margin: "0 15px" }} />
|
|
123
|
+ </IconButton>
|
|
124
|
+ </Box>
|
|
125
|
+ </TableCell>
|
|
126
|
+ <TableCell align='center'>
|
|
127
|
+ <Typography variant='h6' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
|
128
|
+ </TableCell>
|
|
129
|
+ </TableRow>
|
|
130
|
+ ))}
|
|
131
|
+ </TableBody>
|
|
132
|
+ </Table>
|
|
133
|
+ </TableContainer>
|
|
134
|
+
|
|
135
|
+ {/* INVOICES */}
|
|
136
|
+ <Grid container spacing={2} sx={{ mb: 5 }}>
|
|
137
|
+
|
|
138
|
+ <Grid item size={3} sx={{ ml: "auto" }}>
|
|
139
|
+ <Box
|
|
140
|
+ display="flex"
|
|
141
|
+ justifyContent="space-between"
|
|
142
|
+ alignItems="center"
|
|
143
|
+ sx={{ mb: 2 }}
|
|
144
|
+ >
|
|
145
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>Subtotal</Typography>
|
|
146
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>{`RM ${parseFloat(500).toFixed(2)}`}</Typography>
|
|
147
|
+ </Box>
|
|
148
|
+ <Box
|
|
149
|
+ display="flex"
|
|
150
|
+ justifyContent="space-between"
|
|
151
|
+ alignItems="center"
|
|
152
|
+ sx={{ mb: 2 }}
|
|
153
|
+ >
|
|
154
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>Shipping</Typography>
|
|
155
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>{`RM ${parseFloat(500).toFixed(2)}`}</Typography>
|
|
156
|
+ </Box>
|
|
157
|
+ <Box
|
|
158
|
+ display="flex"
|
|
159
|
+ justifyContent="space-between"
|
|
160
|
+ alignItems="center"
|
|
161
|
+ sx={{ mb: 2 }}
|
|
162
|
+ >
|
|
163
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>Taxes</Typography>
|
|
164
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>{`RM ${parseFloat(500).toFixed(2)}`}</Typography>
|
|
165
|
+ </Box>
|
|
166
|
+ <Box
|
|
167
|
+ display="flex"
|
|
168
|
+ justifyContent="space-between"
|
|
169
|
+ alignItems="center"
|
|
170
|
+ sx={{ mb: 2 }}
|
|
171
|
+ >
|
|
172
|
+ <Typography variant="body1" sx={{ fontWeight: "400" }}>Total</Typography>
|
|
173
|
+ <Typography variant="body1" sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(500).toFixed(2)}`}</Typography>
|
|
174
|
+ </Box>
|
|
175
|
+ </Grid>
|
|
176
|
+
|
|
177
|
+ </Grid>
|
|
178
|
+
|
|
179
|
+ {/* BUY NOW */}
|
|
180
|
+ <Box sx={{ mb: 15 }}>
|
|
181
|
+ <Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
|
|
182
|
+ <Typography variant='body2'><span style={{ fontWeight: "bolder" }}>NEED HELP?</span> CALL US: +44 (0)10 2345 6789 | EMAIL CUSTOMER CARE | SHIPPING INFORMATION | RETURNS & EXCHANGES</Typography>
|
|
183
|
+ <Button
|
|
184
|
+ variant="contained"
|
|
185
|
+ color="common.black"
|
|
186
|
+ onClick={()=>{window.location.href = "/checkout"}}
|
|
187
|
+ sx={{
|
|
188
|
+ backgroundColor: (theme) => theme.palette.common.black,
|
|
189
|
+ color: "white",
|
|
190
|
+ textTransform: "none",
|
|
191
|
+ px: 8,
|
|
192
|
+ py: 2,
|
|
193
|
+ "&:hover": {
|
|
194
|
+ backgroundColor: (theme) => theme.palette.grey[900],
|
|
195
|
+ },
|
|
196
|
+ }}>BUY NOW</Button>
|
|
197
|
+ </Box>
|
|
198
|
+ </Box>
|
|
199
|
+
|
|
200
|
+ <SocialMedia />
|
|
201
|
+ <Feature />
|
|
202
|
+ </Box>
|
|
203
|
+ </>
|
6
|
204
|
)
|
7
|
205
|
}
|
8
|
206
|
|