Skip to content

Commit 0014c98

Browse files
committed
fix cart drawer
1 parent 4ae470d commit 0014c98

2 files changed

Lines changed: 29 additions & 11 deletions

File tree

frontend/src/App.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ const Overlay = ({ type, onClose, cartItems, wishlistItems, onRemoveFromCart, on
207207
<button className="btn-primary" onClick={onClose}>CONTINUE SHOPPING</button>
208208
</div>
209209
) : (
210+
<>
210211
<div className="cart-items">
211212
{cartItems.map((item, i) => (
212213
<div key={i} className="cart-item">
@@ -222,12 +223,15 @@ const Overlay = ({ type, onClose, cartItems, wishlistItems, onRemoveFromCart, on
222223
</button>
223224
</div>
224225
))}
226+
</div>
227+
<div className="cart-footer">
225228
<div className="cart-total">
226229
<span>Total</span>
227230
<span>{cartTotal.toLocaleString('en-IN')}</span>
228231
</div>
229232
<button className="btn-primary checkout-btn">PROCEED TO CHECKOUT</button>
230233
</div>
234+
</>
231235
)
232236
) : (
233237
wishlistItems.length === 0 ? (

frontend/src/index.css

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,22 @@ ul {
214214
.close-btn:hover { color: var(--brand-red); }
215215

216216
.overlay-content {
217-
padding: 2rem;
217+
padding: 0;
218+
flex: 1;
219+
display: flex;
220+
flex-direction: column;
221+
justify-content: flex-start;
222+
align-items: stretch;
223+
overflow-y: auto;
224+
}
225+
226+
.overlay-content .empty-state {
218227
flex: 1;
219228
display: flex;
220229
flex-direction: column;
221230
justify-content: center;
222231
align-items: center;
232+
padding: 2rem;
223233
}
224234

225235
.empty-state {
@@ -987,17 +997,21 @@ ul {
987997
}
988998

989999
/* Cart & Wishlist Drawer Items */
990-
.cart-items { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
991-
.cart-item { display: flex; gap: 12px; align-items: center; padding: 12px; background: #f9f9f9; border-radius: 10px; }
992-
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
1000+
.cart-items { display: flex; flex-direction: column; gap: 0; padding: 0 20px; flex: 1; overflow-y: auto; }
1001+
.cart-item { display: flex; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid #f2f2f2; }
1002+
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 12px; background: #f7f7f7; }
9931003
.cart-item-info { flex: 1; }
994-
.cart-item-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
995-
.cart-item-size, .cart-item-qty { font-size: 12px; color: #666; }
996-
.cart-item-price { font-weight: 700; font-size: 14px; margin-top: 4px; color: #e85d04; }
997-
.remove-btn { background: none; border: none; cursor: pointer; color: #999; padding: 4px; }
998-
.remove-btn:hover { color: #e85d04; }
999-
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; padding: 12px 0; border-top: 1px solid #eee; margin-top: 8px; }
1000-
.checkout-btn { width: 100%; margin-top: 8px; }
1004+
.cart-item-name { font-weight: 700; font-size: 13px; margin-bottom: 5px; color: #1a1a1a; line-height: 1.3; }
1005+
.cart-item-size { font-size: 12px; color: #888; margin-bottom: 2px; }
1006+
.cart-item-qty { font-size: 12px; color: #888; margin-bottom: 6px; }
1007+
.cart-item-price { font-weight: 800; font-size: 15px; color: #e85d04; }
1008+
.remove-btn { background: #f5f5f5; border: none; cursor: pointer; color: #aaa; padding: 8px; border-radius: 8px; transition: all 0.2s; }
1009+
.remove-btn:hover { background: #ffe8e0; color: #e85d04; }
1010+
.cart-footer { padding: 16px 20px 24px; border-top: 2px solid #f2f2f2; }
1011+
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
1012+
.cart-total span:first-child { font-size: 14px; color: #888; font-weight: 500; }
1013+
.cart-total span:last-child { font-weight: 800; font-size: 20px; color: #1a1a1a; }
1014+
.checkout-btn { width: 100%; padding: 16px; font-size: 14px; letter-spacing: 1px; border-radius: 14px; }
10011015
.wishlist-overlay.wishlisted { color: #e85d04; }
10021016
.wishlist-btn-large.wishlisted { background: #fff0e6; color: #e85d04; border-color: #e85d04; }
10031017

0 commit comments

Comments
 (0)