From c4966136d709163e2081bf3af9fd41e60d24d8f9 Mon Sep 17 00:00:00 2001 From: parsaaghayi Date: Fri, 12 Jun 2026 01:32:10 +0330 Subject: [PATCH] fix: update import paths for lib folders in components --- .../application/components/AddressModal.tsx | 2 +- frontend/application/components/ArchivePage.tsx | 8 ++++---- frontend/application/components/AuthModal.tsx | 4 ++-- frontend/application/components/B2BPortal.tsx | 6 +++--- frontend/application/components/BlogPage.tsx | 4 ++-- frontend/application/components/CartDrawer.tsx | 6 +++--- .../application/components/CheckoutPage.tsx | 10 +++++----- frontend/application/components/ErrorPages.tsx | 7 +++++-- .../application/components/FeaturedProducts.tsx | 6 +++--- frontend/application/components/Header.tsx | 6 +++--- frontend/application/components/Hero.tsx | 2 +- .../application/components/IngredientWiki.tsx | 6 +++--- frontend/application/components/LoginModal.tsx | 4 ++-- .../application/components/NetworkBanner.tsx | 2 +- .../application/components/OrderSuccess.tsx | 4 ++-- .../application/components/OrderTracking.tsx | 2 +- frontend/application/components/PetProfile.tsx | 8 ++++---- frontend/application/components/ProductPage.tsx | 12 ++++++------ .../components/SearchResultsPage.tsx | 17 ++++++++++------- .../application/components/SmartAdvisor.tsx | 2 +- frontend/application/components/Tooltip.tsx | 4 ++-- .../application/components/UserDashboard.tsx | 4 ++-- 22 files changed, 66 insertions(+), 60 deletions(-) diff --git a/frontend/application/components/AddressModal.tsx b/frontend/application/components/AddressModal.tsx index dbdaadc..cfb951d 100644 --- a/frontend/application/components/AddressModal.tsx +++ b/frontend/application/components/AddressModal.tsx @@ -3,7 +3,7 @@ import React, { useState, useEffect } from "react"; import { motion, AnimatePresence } from "motion/react"; import { X, MapPin, User, Phone, Hash, Save, Check } from "lucide-react"; import { toPersian, cn } from "../lib/utils"; -import { Address } from "../store/userStore"; +import { Address } from "../lib/store/userStore"; import { toast } from "sonner"; interface AddressModalProps { diff --git a/frontend/application/components/ArchivePage.tsx b/frontend/application/components/ArchivePage.tsx index 506d676..c963aea 100644 --- a/frontend/application/components/ArchivePage.tsx +++ b/frontend/application/components/ArchivePage.tsx @@ -1,8 +1,8 @@ "use client"; import React, { useState, useMemo, useEffect } from "react"; -import { Product, PetType } from "../data/products"; -import { usePetStore } from "../store/usePetStore"; -import { productService } from "../services/productService"; +import { Product, PetType } from "../lib/data/products"; +import { usePetStore } from "../lib/store/usePetStore"; +import { productService } from "../lib/services/productService"; import { motion, AnimatePresence } from "motion/react"; import { ProductCardSkeleton } from "./Skeleton"; import { toast } from "sonner"; @@ -23,7 +23,7 @@ import { Plus, Loader2 } from "lucide-react"; -import { useCartStore } from "../store/cartStore"; +import { useCartStore } from "../lib/store/cartStore"; import SafeImage from "./SafeImage"; const CATEGORIES = [ diff --git a/frontend/application/components/AuthModal.tsx b/frontend/application/components/AuthModal.tsx index 5ac224d..10b5df5 100644 --- a/frontend/application/components/AuthModal.tsx +++ b/frontend/application/components/AuthModal.tsx @@ -2,8 +2,8 @@ import React, { useState, useEffect, useRef } from "react"; import { motion, AnimatePresence } from "motion/react"; import { X, User, Building2, Heart, ShieldCheck, Phone, Key, LogIn, ArrowRight, RefreshCw } from "lucide-react"; -import { useUserStore, UserRole } from "../store/userStore"; -import { authService } from "../services/authService"; +import { useUserStore, UserRole } from "../lib/store/userStore"; +import { authService } from "../lib/services/authService"; import { toast } from "sonner"; import { toPersian } from "../lib/utils"; diff --git a/frontend/application/components/B2BPortal.tsx b/frontend/application/components/B2BPortal.tsx index 8e6eb3e..989cd61 100644 --- a/frontend/application/components/B2BPortal.tsx +++ b/frontend/application/components/B2BPortal.tsx @@ -1,8 +1,8 @@ "use client"; import React, { useState, useEffect } from "react"; -import { Product } from "../data/products"; -import { useCartStore } from "../store/cartStore"; -import { productService } from "../services/productService"; +import { Product } from "../lib/data/products"; +import { useCartStore } from "../lib/store/cartStore"; +import { productService } from "../lib/services/productService"; import { motion, AnimatePresence } from "motion/react"; import { Building2, diff --git a/frontend/application/components/BlogPage.tsx b/frontend/application/components/BlogPage.tsx index df24d53..976067f 100644 --- a/frontend/application/components/BlogPage.tsx +++ b/frontend/application/components/BlogPage.tsx @@ -2,8 +2,8 @@ import React from "react"; import { motion } from "motion/react"; import { ChevronRight, Calendar, User, ArrowLeft, Sparkles, BookOpen } from "lucide-react"; -import { Product } from "../data/products"; -import { productService } from "../services/productService"; +import { Product } from "../lib/data/products"; +import { productService } from "../lib/services/productService"; const BLOG_POSTS = [ { diff --git a/frontend/application/components/CartDrawer.tsx b/frontend/application/components/CartDrawer.tsx index c9f2532..ee86a75 100644 --- a/frontend/application/components/CartDrawer.tsx +++ b/frontend/application/components/CartDrawer.tsx @@ -3,9 +3,9 @@ import React, { useState, useEffect } from "react"; import { X, Trash2, Plus, Minus, ShoppingBag, ShieldCheck, ArrowLeft, Ticket, Sparkles, CheckCircle2 } from "lucide-react"; import { motion, AnimatePresence } from "motion/react"; import { toPersian, cn } from "../lib/utils"; -import { useCartStore } from "../store/cartStore"; -import { Product } from "../data/products"; -import { productService } from "../services/productService"; +import { useCartStore } from "../lib/store/cartStore"; +import { Product } from "../lib/data/products"; +import { productService } from "../lib/services/productService"; import SafeImage from "./SafeImage"; import { toast } from "sonner"; diff --git a/frontend/application/components/CheckoutPage.tsx b/frontend/application/components/CheckoutPage.tsx index edde4ef..065a52f 100644 --- a/frontend/application/components/CheckoutPage.tsx +++ b/frontend/application/components/CheckoutPage.tsx @@ -17,11 +17,11 @@ import { PlusCircle } from "lucide-react"; import { toPersian, cn } from "../lib/utils"; -import { useCartStore } from "../store/cartStore"; -import { usePetStore } from "../store/usePetStore"; -import { useUserStore } from "../store/userStore"; -import { Product } from "../data/products"; -import { productService } from "../services/productService"; +import { useCartStore } from "../lib/store/cartStore"; +import { usePetStore } from "../lib/store/usePetStore"; +import { useUserStore } from "../lib/store/userStore"; +import { Product } from "../lib/data/products"; +import { productService } from "../lib/services/productService"; import { toast } from "sonner"; import { useRouter } from 'next/navigation'; diff --git a/frontend/application/components/ErrorPages.tsx b/frontend/application/components/ErrorPages.tsx index bbd1b9a..39556d5 100644 --- a/frontend/application/components/ErrorPages.tsx +++ b/frontend/application/components/ErrorPages.tsx @@ -2,7 +2,10 @@ import React from 'react'; import { FileQuestion, AlertCircle, Home, RefreshCw } from 'lucide-react'; -export const NotFoundPage = ({ onGoHome }: { onGoHome: () => void }) => { +import { useRouter } from 'next/navigation'; + +export const NotFoundPage = () => { + const router = useRouter(); return (
@@ -21,7 +24,7 @@ export const NotFoundPage = ({ onGoHome }: { onGoHome: () => void }) => {

@@ -61,7 +64,7 @@ export default function SearchResultsPage({ query, onProductClick, onBack }: { q onProductClick(product)} + onClick={() => router.push(`/shop/${product.id}`)} className="bg-white rounded-[2.5rem] p-8 border border-medical-gray-200 group cursor-pointer hover:shadow-2xl hover:shadow-canina-blue/10 transition-all flex flex-col relative" >
@@ -121,7 +124,7 @@ export default function SearchResultsPage({ query, onProductClick, onBack }: { q

محصولات پیشنهادی (پرفروش)

{bestSellers.map(p => ( -
onProductClick(p)} className="cursor-pointer group"> +
router.push(`/shop/${p.id}`)} className="cursor-pointer group">
diff --git a/frontend/application/components/SmartAdvisor.tsx b/frontend/application/components/SmartAdvisor.tsx index 97d8a86..1783c85 100644 --- a/frontend/application/components/SmartAdvisor.tsx +++ b/frontend/application/components/SmartAdvisor.tsx @@ -1,7 +1,7 @@ "use client"; import React, { useState } from "react"; import { motion, AnimatePresence } from "motion/react"; -import { useSettingsStore } from "../store/settingsStore"; +import { useSettingsStore } from "../lib/store/settingsStore"; import { Dog, Cat, diff --git a/frontend/application/components/Tooltip.tsx b/frontend/application/components/Tooltip.tsx index 0f55389..c6b4451 100644 --- a/frontend/application/components/Tooltip.tsx +++ b/frontend/application/components/Tooltip.tsx @@ -2,8 +2,8 @@ import React, { useState } from 'react'; import { motion, AnimatePresence } from 'motion/react'; import { Info, ExternalLink } from 'lucide-react'; -import { SCIENTIFIC_TERMS } from '../data/scientificTerms'; -import { useSettingsStore } from '../store/settingsStore'; +import { SCIENTIFIC_TERMS } from '../lib/data/scientificTerms'; +import { useSettingsStore } from '../lib/store/settingsStore'; interface TooltipProps { termKey: string; diff --git a/frontend/application/components/UserDashboard.tsx b/frontend/application/components/UserDashboard.tsx index dbf5950..0a7a718 100644 --- a/frontend/application/components/UserDashboard.tsx +++ b/frontend/application/components/UserDashboard.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { motion, AnimatePresence } from "motion/react"; import { User, ShoppingBag, Wallet, MapPin, LogOut, ChevronRight, Package, Calendar, UserCircle, ShoppingCart, Trash2, Edit2, Phone, Hash, CheckCircle2, ArrowUpCircle, ArrowDownCircle, Info, Clock, CheckCircle, Heart, Sparkles } from "lucide-react"; import { OrderRowSkeleton } from "./Skeleton"; -import { useUserStore, Address } from "../store/userStore"; -import { useCartStore } from "../store/cartStore"; +import { useUserStore, Address } from "../lib/store/userStore"; +import { useCartStore } from "../lib/store/cartStore"; import { toPersian, cn } from "../lib/utils"; import { toast } from "sonner"; import OrderDetailsModal from "./OrderDetailsModal";