@@ -40,18 +40,21 @@ function Home() {
40
40
if ( ! product ) {
41
41
throw new Error ( "Produto não encontrado" ) ;
42
42
}
43
- const response = await fetch ( "https://bazzar-39eb.onrender.com/api/cart" , {
44
- method : "POST" ,
45
- headers : {
46
- Authorization : `Bearer ${ token } ` ,
47
- "Content-Type" : "application/json" ,
48
- } ,
49
- body : JSON . stringify ( {
50
- user_id : 1 ,
51
- product_id : product . id ,
52
- quantity : 1 ,
53
- } ) ,
54
- } ) ;
43
+ const response = await fetch (
44
+ "https://bazzar-39eb.onrender.com/api/cart" ,
45
+ {
46
+ method : "POST" ,
47
+ headers : {
48
+ Authorization : `Bearer ${ token } ` ,
49
+ "Content-Type" : "application/json" ,
50
+ } ,
51
+ body : JSON . stringify ( {
52
+ user_id : 1 ,
53
+ product_id : product . id ,
54
+ quantity : 1 ,
55
+ } ) ,
56
+ }
57
+ ) ;
55
58
56
59
if ( ! response . ok ) {
57
60
throw new Error ( "Erro ao adicionar ao carrinho" ) ;
@@ -364,10 +367,10 @@ function Home() {
364
367
365
368
< div className = "flex relative w-full h-96 overflow-hidden bg-[#FF3300] shadow-lg rounded-[35px]" >
366
369
< div className = "absolute p-6 z-20" >
367
- < h1 className = "text-white font-bold text-5xl w-40 leading-[70px] italic" >
370
+ < h1 className = "text-white font-bold text-3xl lg:text- 5xl w-40 leading-[70px] italic p-4 " >
368
371
Decorative Pillowcases Velvet
369
372
</ h1 >
370
- < h2 className = "text-white font-bold text-3xl italic" >
373
+ < h2 className = "text-white font-bold text-xl lg:text- 3xl italic p-4 " >
371
374
Bring charm and modernity to < br > </ br > your interior
372
375
</ h2 >
373
376
</ div >
@@ -416,7 +419,9 @@ function Home() {
416
419
) )
417
420
) : (
418
421
< div className = "w-full flex gap-2 items-center justify-center pt-5 h-80" >
419
- < h1 className = "font-bold" > None of the products match the search</ h1 >
422
+ < h1 className = "font-bold" >
423
+ No products found
424
+ </ h1 >
420
425
< h1 className = "font-bold text-[#FF3300] text-xl" > :(</ h1 >
421
426
</ div >
422
427
) }
@@ -425,13 +430,13 @@ function Home() {
425
430
< div
426
431
className = {
427
432
showCart
428
- ? "absolute p-2 top-28 rounded-lg right-14 bg-white w-[500px] h-[400px] shadow-lg z-50 flex flex-col gap-4 overflow-auto"
433
+ ? "absolute p-2 top-28 rounded-lg right-12 lg:right- 14 bg-white w-[300px] lg: w-[500px] h-[400px] shadow-lg z-50 flex flex-col gap-4 overflow-auto"
429
434
: "hidden"
430
435
}
431
436
>
432
437
{ cartItems . length === 0 && (
433
438
< div className = "flex flex-col items-center justify-center gap-10 w-full h-full" >
434
- < h1 className = "font-bold text-3xl" > The cart is empty 😪</ h1 >
439
+ < h1 className = "font-bold text-2xl lg:text- 3xl" > The cart is empty 😪</ h1 >
435
440
< svg
436
441
className = "w-40 h-40"
437
442
viewBox = "0 0 24 24"
@@ -453,7 +458,7 @@ function Home() {
453
458
return (
454
459
< div
455
460
key = { item . id }
456
- className = "flex items-center justify-between p-2 gap-2 w-full h-14 border border-[#999999] rounded-[18px]"
461
+ className = "flex flex-wrap items-center justify-between p-2 gap-2 w-full border border-[#999999] rounded-[18px]"
457
462
>
458
463
< div className = "flex gap-1 items-center" >
459
464
< div className = "flex items-center justify-center w-8 h-8" >
@@ -465,12 +470,12 @@ function Home() {
465
470
/>
466
471
</ div >
467
472
< h2 className = "font-bold truncate w-40" > { item . name } </ h2 >
468
- < h2 className = "font-bold truncate max-w-40 text-[#FF3300]" >
469
- US$ { item . price }
470
- </ h2 >
471
473
</ div >
472
474
473
475
< div className = "flex gap-4 items-center justify-center" >
476
+ < h2 className = "font-bold truncate max-w-40 text-[#FF3300]" >
477
+ US$ { item . price }
478
+ </ h2 >
474
479
{ /* Botão de Deletar item do carrinho */ }
475
480
< button
476
481
onClick = { ( ) => removeFromCart ( item . product_id ) }
@@ -542,7 +547,7 @@ function Home() {
542
547
</ svg >
543
548
</ button >
544
549
</ div >
545
- < h2 className = "font-bold text-xl" > x{ item . quantity } </ h2 >
550
+ < h2 className = "font-bold text-xl w-10 " > x{ item . quantity } </ h2 >
546
551
</ div >
547
552
) ;
548
553
} ) }
0 commit comments