Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout page redesign #214

Merged
merged 6 commits into from
Jul 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
handleDelete cart items and bug fix
  • Loading branch information
ramo-dev committed Jul 9, 2024
commit a018ade7b76ebfe1abd1a7e9c40a453f011c4c00
19 changes: 14 additions & 5 deletions src/pages/shop/OrderSummaryPage.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable react/react-in-jsx-scope */
import { Dialog, Transition } from "@headlessui/react";
import { useState, Fragment } from "react";
import { FaTrash } from "react-icons/fa";
import { MdOutlineAddShoppingCart } from "react-icons/md";
import { CiShoppingTag } from "react-icons/ci";
import { FaTrash } from "react-icons/fa";

import { LazyLoadImage } from "react-lazy-load-image-component";

import { Link } from "react-router-dom";
@@ -26,7 +27,7 @@ function Checkout() {
} = useMakeOrder();

const [open, setOpen] = useState(false);
const [count, setCount] = useState(1);

const [formData, setFormData] = useState(null);
const [address, setAddress] = useState("");

@@ -50,10 +51,17 @@ function Checkout() {
console.log(data);
};

const handleDeleteItem = (productId) => {

products.cart_items?.filter((item) => item.product.id !== productId);


};

return (
<>
<ItemHeader show={() => setOpen((prev) => !prev)} />
<div className="px-8 m-auto mb-10 max-w-screen-2xl justify-between w-full space-y-10 md:space-y-10 text-[#323433]">
<div className="px-8 sm:px-10 m-auto mb-10 max-w-screen-2xl justify-between w-full space-y-10 md:space-y-10 text-[#323433]">
<div className="flex flex-col md:flex-row justify-between space-y-8 sm:space-y-0">
<PaymentMethd isPending={isPending} handleSubmit={handleFormData} />

@@ -81,7 +89,7 @@ function Checkout() {

<div className="text-base space-y-2 w-full">
<span className="border bg-pink-200 flex p-1 px-2 rounded-full items-center gap-2 text-sm text-pink-700 w-max">
<MdOutlineAddShoppingCart />
<CiShoppingTag />
{id}
</span>
<p className="">
@@ -100,6 +108,7 @@ function Checkout() {
<button
className="text-red-600 mb-5 text-lg"
type="button"
onClick={()=>handleDeleteItem(productId)}
>
<FaTrash />
</button>
1 change: 1 addition & 0 deletions src/pages/shop/PaymentMethd.jsx
Original file line number Diff line number Diff line change
@@ -158,6 +158,7 @@ function PaymentMethod({ handleSubmit, isPending, setForm }) {
placeholder="Select Country"
value={country}
required
aria-label="selection"
/>
</div>
<div className="flex-1">
Loading