Skip to content

Commit e5bc487

Browse files
Merge pull request #34 from poudelsanchit/Test-Branch
update 10 files
2 parents f9561ca + d0d8e2f commit e5bc487

9 files changed

Lines changed: 72 additions & 73 deletions

File tree

db.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,18 +3268,5 @@
32683268
}
32693269
]
32703270
}
3271-
],
3272-
3273-
3274-
3275-
"profile": [
3276-
{
3277-
"name": "typicode",
3278-
"id": 1
3279-
},
3280-
{
3281-
"name": "typicode",
3282-
"id": 1
3283-
}
3284-
]
3271+
]
32853272
}

src/Components/Cards/Card.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { BsDot,BsTruck } from "react-icons/bs";
99
import { useSelector, useDispatch } from 'react-redux'
1010
import { addItemToCart} from '../../redux/Slices/Cart/cartSlice';
1111
import { addToFavorites, removeFromFavorites} from '../../redux/Slices/favorites/favorites'
12+
import Reviews from '../ReviewsSection/Reviews';
1213
const Card = () => {
1314
const {type} = useParams();
1415
const id= useParams();
@@ -90,6 +91,8 @@ const handleSelectColor=(color)=>{
9091
}
9192

9293
}
94+
95+
9396

9497
return (
9598
<div className="flex flex-col w-full h-auto justify-center items-center gap-20 ">
@@ -248,7 +251,7 @@ const handleSelectColor=(color)=>{
248251
</div>
249252

250253
</div>
251-
{/* <Reviews data={product.reviews} /> */}
254+
<Reviews data={product.reviews} />
252255
</div>
253256
);
254257
}

src/Components/Inputs/GetNumberRange.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const GetNumberRange = ({defaultvalue,min,onValueChange }) => {
3232
return (
3333
<div className='flex justify-evenly items-centerg gap-1' >
3434
<div className='sm:w-10 w-5 h-5 sm:h-10 bg-[#edf2f7] flex justify-center items-center rounded-sm' {...dec} onChange={()=>setQty({"name": valueAsNumber})}>-</div>
35-
<input type="number" className='border-2 rounded-sm sm:w-10 w-10 h-5 sm:h-10 focus:outline-none pl-2' {...input}/>
35+
<input type="number" className='border-2 rounded-sm sm:w-10 w-10 h-5 sm:h-10 focus:outline-none pl-2 text-xs' {...input}/>
3636
<div className='sm:w-10 w-5 h-5 sm:h-10 bg-[#edf2f7] flex justify-center items-center rounded-sm' {...inc} onChange={()=>setQty( value)}>+</div>
3737

3838
</div>

src/Components/Payments/Cart/Cart.jsx

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { getTotalPrice } from '../../../redux/Slices/Cart/cartSlice';
66
import { getSumOfProducts } from '../../../redux/Slices/Cart/cartSlice';
77
import { useNavigate } from 'react-router-dom';
88

9-
const Shipping = ({handleToggle}) => {
9+
const Shipping = () => {
1010
const navigate = useNavigate();
1111
const cartItems = useSelector(state=>state.cart.items)
12-
const subTotal = useSelector(getTotalPrice);
12+
console.log(cartItems.length)
1313
const tax= 2;
1414
const total= useSelector(getSumOfProducts)
1515

@@ -20,57 +20,66 @@ const handleCheckout=()=>{
2020

2121
return (
2222
<>
23+
{
24+
cartItems.length!==0?
2325
<div className="flex flex-col w-full h-screen items-center ">
24-
<div className="flex lg:flex-row flex-col lg:w-11/12 w-full gap-10 ">
25-
<div className=" lg:w-8/12 w-full font-Poppins flex flex-col lg:gap-5 gap-1 ">
26-
<div className="lg:text-3xl text-xl font-medium tracking-tighter p-2 ">
27-
Prodcuts
26+
<div className="flex lg:flex-row flex-col lg:w-11/12 w-full gap-10 ">
27+
<div className=" lg:w-8/12 w-full font-Poppins flex flex-col lg:gap-5 gap-1 ">
28+
<div className="lg:text-3xl text-xl font-medium tracking-tighter p-2 ">
29+
Prodcuts
30+
</div>
31+
<div className="flex flex-col gap-2 w-full p-2 ">
32+
{cartItems.map((items) => {
33+
return <EachCard items={items} />;
34+
})}
35+
</div>
36+
</div>
37+
<div className="h-max lg:w-4/12 w-full lg:pb-5 lg:mt-12 rounded-md transition-all flex flex-col lg:pl-5 lg:pr-5 p-2 ">
38+
<div className="w-full border-2 p-2 rounded-md lg:text-xl ">
39+
<div className="font-semibold font-Poppins pb-2 border-b-2 pt-2">
40+
Order Summary
2841
</div>
29-
<div className="flex flex-col gap-2 w-full p-2 ">
30-
{cartItems.map((items) => {
31-
return <EachCard items={items} />;
32-
})}
42+
<div className=" font-Poppins flex pb-2">
43+
{" "}
44+
<div>Subtotal:</div> <div className="ml-auto ">$ {total}</div>{" "}
3345
</div>
34-
</div>
35-
<div className="h-max lg:w-4/12 w-full lg:pb-5 lg:mt-12 rounded-md transition-all flex flex-col lg:pl-5 lg:pr-5 p-2 ">
36-
<div className="w-full border-2 p-2 rounded-md lg:text-xl ">
37-
<div className="font-semibold font-Poppins pb-2 border-b-2 pt-2">
38-
Order Summary
39-
</div>
40-
<div className=" font-Poppins flex pb-2">
41-
{" "}
42-
<div>Subtotal:</div> <div className="ml-auto ">$ {total}</div>{" "}
43-
</div>
44-
<div className=" font-Poppins flex pb-2">
45-
{" "}
46-
<div>Shipping Fee:</div>{" "}
47-
<div className="ml-auto "> $ {tax}</div>{" "}
48-
</div>
49-
<div className=" font-Poppins flex pb-2">
46+
<div className=" font-Poppins flex pb-2">
47+
{" "}
48+
<div>Shipping Fee:</div>{" "}
49+
<div className="ml-auto "> $ {tax}</div>{" "}
50+
</div>
51+
<div className=" font-Poppins flex pb-2">
52+
{" "}
53+
<div>Total :</div>{" "}
54+
<div className="ml-auto text-red-600 font-semibold">
5055
{" "}
51-
<div>Total :</div>{" "}
52-
<div className="ml-auto text-red-600 font-semibold">
53-
{" "}
54-
$ {total + 2}
55-
</div>{" "}
56-
</div>
57-
<Button
58-
className="flex gap-3 lg:mt-10 mt-2 text-4xl "
59-
variant="solid"
60-
bgColor="black"
61-
color="white"
62-
colorScheme="#ffffff"
63-
height={12}
64-
_hover={{ bgColor: "#4F5054", color: "white" }}
65-
onClick={handleCheckout}
66-
>
67-
<CiShoppingCart className="text-2xl" />
68-
Proceed to checkout
69-
</Button>
56+
$ {total + 2}
57+
</div>{" "}
7058
</div>
59+
<Button
60+
className="flex gap-3 lg:mt-10 mt-2 text-4xl "
61+
variant="solid"
62+
bgColor="black"
63+
color="white"
64+
colorScheme="#ffffff"
65+
height={12}
66+
_hover={{ bgColor: "#4F5054", color: "white" }}
67+
onClick={handleCheckout}
68+
>
69+
<CiShoppingCart className="text-2xl" />
70+
Proceed to checkout
71+
</Button>
7172
</div>
7273
</div>
7374
</div>
75+
</div> :
76+
<div className='w-full h-screen flex justify-center'>
77+
<div className='w-11/12 pt-5 text-xl'>No Products in cart</div>
78+
</div>
79+
}
80+
81+
82+
7483
</>
7584
);
7685
}

src/Components/Payments/Cart/EachCard.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ const onOptionChangeHandler=(event)=>{
5757
<div className="flex flex-col m-1 justify-evenly w-full">
5858
<div className="font-bold sm:text-xl text-sm">{items.name}</div>
5959

60-
<div className=" text-base flex sm:flex-row flex-col justify-start sm:gap-10 gap-2 text-secondary-text">
61-
<div className='flex gap-5 sm:flex-row '>
62-
<div className="flex items-center gap-2">
63-
<span className="font-medium sm:text-base text-xs">Qty: </span>
60+
<div className=" text-base flex sm:flex-row flex-col justify-start sm:gap-10 gap-2 text-secondary-text pt-2">
61+
<div className='flex gap-2 sm:gap-5 sm:flex-row flex-col '>
62+
<div className="flex items-center ">
63+
<span className="font-medium sm:text-base text-xs w-10">Qty: </span>
6464
<GetNumberRange
6565
defaultvalue={qty}
6666
min={1}
6767
onValueChange={handleQtyChange}
6868
/>
6969
</div>
70-
<div className="flex items-center gap-2">
71-
<span className="font-medium sm:text-base text-xs">Size: </span>
70+
<div className="flex items-center ">
71+
<span className="font-medium sm:text-base text-xs w-10">Size: </span>
7272
<GetSizeRange
7373
max={44}
7474
defaultvalue={size}
@@ -100,7 +100,7 @@ const onOptionChangeHandler=(event)=>{
100100
</div>
101101
</div>
102102
<div className='flex h-full justify-center items-center cursor-pointer text-3xl' onClick={()=>dispatch(removeItemFromCart(items.productId))}><CiTrash/></div>
103-
<div className="hidden lg:flex justify-center items-center h-full ml-auto font-Poppins font-medium text-lg w-20 bg-purple-600 text-white rounded-r-md ">
103+
<div className="hidden lg:flex justify-center items-center h-full ml-auto font-Poppins font-medium text-lg w-20 text-black rounded-r-md ">
104104
{" "}
105105
${totalPrice}
106106
</div>

src/Components/Payments/Checkout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ const Billing = ({handleToggle}) => {
226226

227227
<div className=" border h-fit rounded-lg grid gap-3 mt-5 lg:w-5/12 w-full ">
228228
<div className=" grid gap-2 px-6 pt-2">
229-
<div className=" border-b-[1px]">
229+
<div className=" border-b-[1px] py-2">
230230
<p className=" text-xl font-bold font-Poppins">Your Products</p>
231231
</div>
232232
{

src/Components/ReviewsSection/Reviews.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Reviews = ({data}) => {
1010

1111

1212
return (
13-
<div className="w-11/12 h-96 p-1 ">
13+
<div className="w-11/12 h-auro p-1 hidden sm:block">
1414
<div className=" mb-2 flex gap-4 text-2xl font-semibold">
1515

1616
<div className={togglePage===2? " text-black cursor-pointer": " text-gray-400 cursor-pointer"} onClick={() => setTogglePage(2)}>

src/Pages/Sports.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ const Sports = () => {
2424
<div className="w-full h-auto flex justify-center mb-4" id="homeShop">
2525
<div className="w-11/12">
2626
<ProductsSwiper products={data} title={'Cleats'} type={'sports'}/>
27-
<ProductsSwiper products={data} title={'Sports'} type={'Boots'}/>
28-
29-
27+
<ProductsSwiper products={data} title={'Sports'} type={'sports'}/>
3028
</div>
3129
</div>
3230
</div>

src/Pages/Women.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const Women = () => {
2323
<div className="w-full h-auto flex justify-center mb-4" id="homeShop">
2424
<div className="w-11/12">
2525
<ProductsSwiper products={data} title={'Women'} type={'women'}/>
26+
<ProductsSwiper products={data} title={''} type={'women'}/>
27+
2628

2729

2830
</div>

0 commit comments

Comments
 (0)