From ab10c25c28ce687b71fcfb42157e35a904767b84 Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Thu, 12 Mar 2026 04:08:57 +0700 Subject: [PATCH] Fix IDE errors from ESLint cleanup --- customer-spa/src/components/CaptchaWidget.tsx | 4 +- .../src/components/CouponURLHandler.tsx | 2 +- customer-spa/src/components/ProductCard.tsx | 3 +- customer-spa/src/components/SEOHead.tsx | 1 - .../src/components/SharedContentLayout.tsx | 2 +- .../src/components/SubscriptionTimeline.tsx | 2 +- .../src/components/WooCommerceHooks.tsx | 2 +- customer-spa/src/components/ui/button.tsx | 11 +- customer-spa/src/components/ui/input.tsx | 3 +- customer-spa/src/contexts/ThemeContext.tsx | 182 ++++++------------ customer-spa/src/hooks/useAddToCartFromUrl.ts | 3 +- customer-spa/src/hooks/useWishlist.ts | 24 ++- customer-spa/src/layouts/BaseLayout.tsx | 9 +- customer-spa/src/lib/api/client.ts | 8 +- customer-spa/src/lib/sectionStyles.ts | 2 +- customer-spa/src/pages/Account/Addresses.tsx | 7 - customer-spa/src/pages/Account/Downloads.tsx | 3 +- .../src/pages/Account/OrderDetails.tsx | 1 + customer-spa/src/pages/Account/Orders.tsx | 1 + customer-spa/src/pages/Account/Wishlist.tsx | 16 +- .../Account/components/AccountLayout.tsx | 36 ++-- customer-spa/src/pages/Cart/index.tsx | 2 +- customer-spa/src/pages/Checkout/index.tsx | 27 ++- customer-spa/src/pages/DynamicPage/index.tsx | 3 +- .../sections/ContactFormSection.tsx | 2 +- .../DynamicPage/sections/ContentSection.tsx | 10 +- .../DynamicPage/sections/HeroSection.tsx | 8 +- .../DynamicPage/sections/ImageTextSection.tsx | 1 - customer-spa/src/pages/Login/index.tsx | 2 +- customer-spa/src/pages/OrderPay/index.tsx | 7 +- customer-spa/src/pages/Product/index.tsx | 7 +- .../src/pages/ResetPassword/index.tsx | 11 +- customer-spa/src/pages/Shop/index.tsx | 7 +- customer-spa/src/pages/ThankYou/index.tsx | 4 +- 34 files changed, 155 insertions(+), 258 deletions(-) diff --git a/customer-spa/src/components/CaptchaWidget.tsx b/customer-spa/src/components/CaptchaWidget.tsx index 9a79bdb..5e989d1 100644 --- a/customer-spa/src/components/CaptchaWidget.tsx +++ b/customer-spa/src/components/CaptchaWidget.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; declare global { interface Window { @@ -118,7 +118,7 @@ export function CaptchaWidget({ provider, siteKey, onToken, action = 'checkout' } } }; - }, [provider, siteKey]); + }, [provider, siteKey, onToken]); // Execute reCAPTCHA when loaded useEffect(() => { diff --git a/customer-spa/src/components/CouponURLHandler.tsx b/customer-spa/src/components/CouponURLHandler.tsx index 2652cc7..df5dfc8 100644 --- a/customer-spa/src/components/CouponURLHandler.tsx +++ b/customer-spa/src/components/CouponURLHandler.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from 'react'; +import { useEffect, useRef } from 'react'; import { useSearchParams } from 'react-router-dom'; import { applyCoupon } from '@/lib/cart/api'; import { useCartStore } from '@/lib/cart/store'; diff --git a/customer-spa/src/components/ProductCard.tsx b/customer-spa/src/components/ProductCard.tsx index 28015ac..25f9356 100644 --- a/customer-spa/src/components/ProductCard.tsx +++ b/customer-spa/src/components/ProductCard.tsx @@ -3,7 +3,7 @@ import { Link, useNavigate } from 'react-router-dom'; import { ShoppingCart, Heart } from 'lucide-react'; import { formatPrice, formatDiscount } from '@/lib/currency'; import { Button } from './ui/button'; -import { useLayout } from '@/contexts/ThemeContext'; + import { useShopSettings } from '@/hooks/useAppearanceSettings'; import { useWishlist } from '@/hooks/useWishlist'; import { useModules } from '@/hooks/useModules'; @@ -26,7 +26,6 @@ interface ProductCardProps { export function ProductCard({ product, onAddToCart }: ProductCardProps) { const navigate = useNavigate(); - const { isClassic, isModern, isBoutique, isLaunch } = useLayout(); const { layout, elements, addToCart, saleBadge, isLoading } = useShopSettings(); const { isEnabled: wishlistEnabled, isInWishlist, toggleWishlist } = useWishlist(); const { isEnabled: isModuleEnabled } = useModules(); diff --git a/customer-spa/src/components/SEOHead.tsx b/customer-spa/src/components/SEOHead.tsx index a17fea4..358e351 100644 --- a/customer-spa/src/components/SEOHead.tsx +++ b/customer-spa/src/components/SEOHead.tsx @@ -28,7 +28,6 @@ export function SEOHead({ }: SEOHeadProps) { const config = (window as any).woonoowCustomer; const siteName = config?.siteName || 'Store'; - const siteUrl = config?.siteUrl || ''; const fullTitle = title ? `${title} | ${siteName}` : siteName; const fullUrl = url || (typeof window !== 'undefined' ? window.location.href : ''); diff --git a/customer-spa/src/components/SharedContentLayout.tsx b/customer-spa/src/components/SharedContentLayout.tsx index 76b27a2..b678a0f 100644 --- a/customer-spa/src/components/SharedContentLayout.tsx +++ b/customer-spa/src/components/SharedContentLayout.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { cn } from '@/lib/utils'; -import * as LucideIcons from 'lucide-react'; + interface SharedContentProps { // Content diff --git a/customer-spa/src/components/SubscriptionTimeline.tsx b/customer-spa/src/components/SubscriptionTimeline.tsx index 7aa6513..04b9b50 100644 --- a/customer-spa/src/components/SubscriptionTimeline.tsx +++ b/customer-spa/src/components/SubscriptionTimeline.tsx @@ -24,7 +24,7 @@ const SubscriptionTimeline: React.FC = ({ subscription }) => { }); }; - const isMonth = subscription.billing_period === 'month'; + const _isMonth = subscription.billing_period === 'month'; const intervalLabel = `${subscription.billing_interval} ${subscription.billing_period}${subscription.billing_interval > 1 ? 's' : ''}`; return ( diff --git a/customer-spa/src/components/WooCommerceHooks.tsx b/customer-spa/src/components/WooCommerceHooks.tsx index 4a1b5d0..1224ee7 100644 --- a/customer-spa/src/components/WooCommerceHooks.tsx +++ b/customer-spa/src/components/WooCommerceHooks.tsx @@ -48,7 +48,7 @@ export function WooCommerceHooks({ context, hookName, productId, className }: Wo /** * Hook to get all hooks for a context */ -export function useWooCommerceHooks(context: 'product' | 'shop' | 'cart' | 'checkout', productId?: number) { +function useWooCommerceHooks(context: 'product' | 'shop' | 'cart' | 'checkout', productId?: number) { return useQuery({ queryKey: ['wc-hooks', context, productId], queryFn: async () => { diff --git a/customer-spa/src/components/ui/button.tsx b/customer-spa/src/components/ui/button.tsx index 29dd27f..44d10f1 100644 --- a/customer-spa/src/components/ui/button.tsx +++ b/customer-spa/src/components/ui/button.tsx @@ -35,12 +35,10 @@ const buttonVariants = cva( export interface ButtonProps extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean -} + VariantProps { } const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { + ({ className, variant, size, ...props }, ref) => { // Simplified: always render as button (asChild not supported for now) return (