Skip to content

Commit 3dfba54

Browse files
committed
Checkpoint from VS Code for cloud agent session
1 parent 5bf79bc commit 3dfba54

2 files changed

Lines changed: 32 additions & 14 deletions

File tree

src/pages/Checkout.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { useState, useRef } from "react";
22
import { Link, useNavigate } from "react-router-dom";
33
import { Lock, ChevronDown, CreditCard, Banknote, Loader2, ArrowLeft } from "lucide-react";
4-
import { Button } from "@/components/ui/button";
5-
import { Input } from "@/components/ui/input";
6-
import { Label } from "@/components/ui/label";
7-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
8-
import { useCartStore } from "@/stores/cartStore";
9-
import AsperLogo from "@/components/brand/AsperLogo";
10-
import { cn } from "@/lib/utils";
11-
import { normalizePrice } from "@/lib/shopify";
12-
import { playSuccessSound } from "@/lib/sounds";
4+
import { Button } from "../components/ui/button";
5+
import { Input } from "../components/ui/input";
6+
import { Label } from "../components/ui/label";
7+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../components/ui/select";
8+
import { useCartStore } from "../stores/cartStore";
9+
import AsperLogo from "../components/brand/AsperLogo";
10+
import { cn } from "../lib/utils";
11+
import { normalizePrice } from "../lib/shopify";
12+
import { playSuccessSound } from "../lib/sounds";
1313

1414
/* ─── Jordanian Location Data ─── */
1515
const CITIES = [
@@ -35,7 +35,7 @@ type PaymentMethod = "cod" | "card";
3535
export default function Checkout() {
3636
const navigate = useNavigate();
3737
const { items, getCheckoutUrl } = useCartStore();
38-
const totalPrice = items.reduce((sum, item) => sum + normalizePrice(item.price.amount) * item.quantity, 0);
38+
const totalPrice = items.reduce((sum: number, item: any) => sum + normalizePrice(item.price.amount) * item.quantity, 0);
3939
const deliveryFee = totalPrice >= 50 ? 0 : 3;
4040
const currency = items[0]?.price.currencyCode || "JOD";
4141

@@ -129,7 +129,7 @@ export default function Checkout() {
129129
<section className="space-y-4">
130130
<h2 className="font-heading text-lg text-foreground">Order Summary</h2>
131131
<div className="space-y-3">
132-
{items.map((item) => (
132+
{items.map((item: any) => (
133133
<div key={item.variantId} className="flex items-center gap-3 rounded-lg border border-border/50 bg-card p-3">
134134
<div className="h-12 w-12 rounded-md bg-secondary overflow-hidden shrink-0 flex items-center justify-center">
135135
{item.product.node.images?.edges?.[0]?.node && (
@@ -178,7 +178,7 @@ export default function Checkout() {
178178
<Input
179179
id="fullName"
180180
value={fullName}
181-
onChange={(e) => setFullName(e.target.value)}
181+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setFullName(e.target.value)}
182182
placeholder="Enter your full name"
183183
className={cn(
184184
"h-12 rounded-xl font-body",
@@ -201,7 +201,7 @@ export default function Checkout() {
201201
id="phone"
202202
type="tel"
203203
value={phone}
204-
onChange={(e) => formatPhone(e.target.value)}
204+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => formatPhone(e.target.value)}
205205
placeholder="7X XXX XXXX"
206206
maxLength={10}
207207
className={cn(
@@ -259,7 +259,7 @@ export default function Checkout() {
259259
<Input
260260
id="address"
261261
value={address}
262-
onChange={(e) => setAddress(e.target.value)}
262+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setAddress(e.target.value)}
263263
placeholder="Building name, street, floor"
264264
className={cn(
265265
"h-12 rounded-xl font-body",

tsconfig.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"jsx": "react-jsx",
7+
"strict": true,
8+
"baseUrl": "./",
9+
"paths": {
10+
"@/*": ["src/*"]
11+
},
12+
"esModuleInterop": true,
13+
"forceConsistentCasingInFileNames": true,
14+
"skipLibCheck": true
15+
},
16+
"include": ["src"],
17+
"exclude": ["node_modules", "dist"]
18+
}

0 commit comments

Comments
 (0)