Skip to content

Commit b3642b1

Browse files
Further modify /cart UI
1 parent df96504 commit b3642b1

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

components/cart/clothingItem.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ const ClothingItem = ({
2323
);
2424
return (
2525
<Row className={"mb-5 " + styles["clothingItem"]}>
26-
<Col className="d-flex text-center justify-content-center align-items-center">
26+
<Col
27+
className="d-flex text-center justify-content-center align-items-center"
28+
xs="4"
29+
>
2730
<Image
2831
src={item.product.images[0]}
2932
width={150}
@@ -33,7 +36,7 @@ const ClothingItem = ({
3336
/>
3437
<h5 className="m-0 ms-4">{item.product.name}</h5>
3538
</Col>
36-
<Col className={styles["clothingRow"]}>
39+
<Col className={styles["clothingRow"]} xs="2">
3740
<h5 className="m-0">${(item.price.cents ?? 0) / 100}</h5>
3841
</Col>
3942
<Col className={styles["clothingRow"]}>

pages/cart.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ const Cart = () => {
7878
</Row>
7979
<Container
8080
className="d-flex flex-column align-items-between"
81-
style={{ width: "80%" }}
81+
style={{ width: "75%" }}
8282
fluid
8383
>
8484
{/* TODO: align header row with ClothingItem at smaller display widths - bootstrap columns? */}
8585
{/* <Row className={styles["cartHeader"]}> */}
8686
<Row className="mt-5 my-4">
8787
{/* <Col className={styles["cartHeaderCol"]}> */}
88-
<Col className="text-center">
88+
<Col className="text-center" xs="4">
8989
<h4>Item</h4>
9090
</Col>
91-
<Col className="text-center">
91+
<Col className="text-center" xs="2">
9292
<h4>Price</h4>
9393
</Col>
9494
<Col className="text-center">
@@ -109,18 +109,20 @@ const Cart = () => {
109109
/>
110110
))}
111111
</Row>
112-
</Container>
113-
<Container className="d-flex flex-column align-items-end mt-3">
114-
<h4 className="w-auto">Total: ${calculateTotal()}</h4>
115-
<Button
116-
className="mt-3"
117-
color="primary"
118-
target="_blank"
119-
onClick={() => handlePay()}
120-
style={{ width: 200, color: "white" }}
121-
>
122-
<h5 style={{ color: "white", margin: "0" }}>Buy Now</h5>
123-
</Button>
112+
<Row>
113+
<Col className="d-flex flex-column align-items-end me-1">
114+
<h4> Total: ${calculateTotal()}</h4>
115+
<Button
116+
className="mt-3"
117+
color="primary"
118+
target="_blank"
119+
onClick={() => handlePay()}
120+
style={{ width: 200, color: "white" }}
121+
>
122+
<h5 style={{ color: "white", margin: "0" }}>Check Out</h5>
123+
</Button>
124+
</Col>
125+
</Row>
124126
</Container>
125127
</section>
126128
</>

styles/modules/Cart.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
// margin-bottom: 40px;
2929
// margin-left: 40px;
3030
// margin-right: 40px;
31-
background-color: rgb(238, 238, 238);
31+
padding: 0px;
32+
background-color: rgb(242, 242, 242);
3233
display: flex;
3334
align-items: center;
34-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
35+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.15);
3536
border-radius: 4px;
3637
}
3738

0 commit comments

Comments
 (0)