Order Confirmed!
-Thank you for your purchase. Your order will be shipped soon.
- Continue Shopping -diff --git a/src/app/cart/page.tsx b/src/app/cart/page.tsx
index 79831ff..4939f89 100644
--- a/src/app/cart/page.tsx
+++ b/src/app/cart/page.tsx
@@ -21,12 +21,13 @@ interface CartContextTypeExtended {
}
const CartPageContent = () => {
- const { cartItems, removeFromCart, updateQuantity, getTotalPrice } = useCart() as CartContextTypeExtended;
+ const { cartItems, removeFromCart, updateQuantity, getTotalPrice } = useCart() as unknown as CartContextTypeExtended;
const navItems = [
{ name: 'Products', id: '/products' },
{ name: 'Cart', id: '/cart' },
{ name: 'Checkout', id: '/checkout' },
+ { name: 'Home', id: '/' }
];
return (
diff --git a/src/app/checkout/page.tsx b/src/app/checkout/page.tsx
index f78de94..58e09cc 100644
--- a/src/app/checkout/page.tsx
+++ b/src/app/checkout/page.tsx
@@ -4,185 +4,101 @@ import { ThemeProvider } from '@/providers/themeProvider/ThemeProvider';
import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay';
import FooterCard from '@/components/sections/footer/FooterCard';
import { useCart } from '@/components/cart/CartProvider';
-import { CreditCard, Truck, Receipt, Facebook, Twitter, Instagram } from 'lucide-react';
-import React, { useState } from 'react';
+import { ShoppingBag, CreditCard, Truck, CheckCircle, Facebook, Twitter, Instagram } from 'lucide-react';
+
+interface CartContextTypeExtended {
+ cartItems: Array<{
+ id: string;
+ imageSrc: string;
+ imageAlt: string;
+ name: string;
+ price: string;
+ quantity: number;
+ }>;
+ removeFromCart: (id: string) => void;
+ updateQuantity: (id: string, quantity: number) => void;
+ getTotalPrice: () => number;
+}
+
+interface CheckoutItem {
+ id: string;
+ name: string;
+ price: string;
+ quantity: number;
+}
const CheckoutPageContent = () => {
- const { cartItems, getTotalPrice, clearCart } = useCart();
- const [formData, setFormData] = useState({
- name: '',
- email: '',
- address: '',
- city: '',
- zip: '',
- cardNumber: '',
- cardExpiry: '',
- cardCVC: '',
- });
- const [orderConfirmed, setOrderConfirmed] = useState(false);
-
- const handleChange = (e) => {
- setFormData({ ...formData, [e.target.name]: e.target.value });
- };
-
- const handleSubmit = (e) => {
- e.preventDefault();
- // Simulate order processing
- console.log('Order submitted:', formData, 'Items:', cartItems);
- setOrderConfirmed(true);
- clearCart(); // Clear cart after successful order
- };
+ const { cartItems, getTotalPrice } = useCart() as unknown as CartContextTypeExtended; // Fix 1: Type assertion
const navItems = [
{ name: 'Products', id: '/products' },
{ name: 'Cart', id: '/cart' },
{ name: 'Checkout', id: '/checkout' },
+ { name: 'Home', id: '/' }
];
- if (orderConfirmed) {
- return (
- <>
- Thank you for your purchase. Your order will be shipped soon.Order Confirmed!
-
Your cart is empty. Please add items before checking out.
+Your cart is empty. Start shopping!
) : ( -
- Get started by editing
- src/app/page.tsx
-
- Find in-depth information about Next.js features and API. -
- - - -- Learn about Next.js in an interactive course with quizzes! -
- - - -- Discover and deploy boilerplate example Next.js projects. -
- - - -- Instantly deploy your Next.js site to a shareable URL with Vercel. -
- -Explore our wide range of high-quality fishing tackle.