From f578ff0de46f036dc8a4a0befb7dbb6c99c304c7 Mon Sep 17 00:00:00 2001 From: Lilith Date: Tue, 20 Jan 2026 05:50:23 -0800 Subject: [PATCH] =?UTF-8?q?chore(src):=20=F0=9F=94=A7=20Update=20component?= =?UTF-8?q?-related=20TypeScript=20files=20in=20src?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @packages/@design-tokens/src/create-theme.ts | 6 +++--- .../src/use-mutation-options.tsx | 6 +++--- .../src/components/SEOAgeGate.tsx | 18 ++++++++---------- .../components/templates/DesktopTemplate.tsx | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/@packages/@design-tokens/src/create-theme.ts b/@packages/@design-tokens/src/create-theme.ts index a272afbd6..04ac2e7a6 100755 --- a/@packages/@design-tokens/src/create-theme.ts +++ b/@packages/@design-tokens/src/create-theme.ts @@ -3,7 +3,7 @@ import { baseTheme } from './theme' /** * Deep merge utility for theme customization */ -function deepMerge>( +function deepMerge>( target: T, source: Partial ): T { @@ -12,8 +12,8 @@ function deepMerge>( for (const key in source) { if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) { output[key] = deepMerge( - target[key] as Record, - source[key] as Record + target[key] as Record, + source[key] as Record ) as T[Extract] } else { output[key] = source[key] as T[Extract] diff --git a/@packages/@hooks/react-query-utils/src/use-mutation-options.tsx b/@packages/@hooks/react-query-utils/src/use-mutation-options.tsx index 56cf20e45..0b965f327 100755 --- a/@packages/@hooks/react-query-utils/src/use-mutation-options.tsx +++ b/@packages/@hooks/react-query-utils/src/use-mutation-options.tsx @@ -7,7 +7,7 @@ import toast from 'react-hot-toast' /** * Configuration for creating standardized mutation options */ -export interface CreateMutationOptionsConfig { +export interface CreateMutationOptionsConfig { /** * Name of the operation being performed (e.g., "create user", "update post") * Used in success/error messages and logging @@ -33,7 +33,7 @@ export interface CreateMutationOptionsConfig { * Custom success callback * Called after query invalidation */ - onSuccess?: (data: any) => void; + onSuccess?: (data: TData) => void; /** * Custom error callback @@ -96,7 +96,7 @@ export interface CreateMutationOptionsConfig { * ``` */ export function useMutationOptions( - config: CreateMutationOptionsConfig + config: CreateMutationOptionsConfig ): UseMutationOptions { const queryClient = useQueryClient() diff --git a/features/seo/frontend-public/src/components/SEOAgeGate.tsx b/features/seo/frontend-public/src/components/SEOAgeGate.tsx index 83796376e..6d45b89b2 100755 --- a/features/seo/frontend-public/src/components/SEOAgeGate.tsx +++ b/features/seo/frontend-public/src/components/SEOAgeGate.tsx @@ -69,17 +69,15 @@ export function SEOAgeGate({ children, exitUrl = 'https://www.google.com', }: SEOAgeGateProps) { + // Calculate bot status immediately (pure function, no side effects) + const botStatus = shouldBypassAgeVerification(); const [isVerified, setIsVerified] = useState(null); - const [isBot, setIsBot] = useState(null); + const [isBot] = useState(botStatus); - // Check verification status on mount + // Check verification status on mount (only for non-bots) useEffect(() => { - // Check if user is a bot - const botStatus = shouldBypassAgeVerification(); - setIsBot(botStatus); - // Check localStorage for existing verification - if (!botStatus) { + if (!isBot) { try { const stored = localStorage.getItem(STORAGE_KEY); setIsVerified(stored === 'true'); @@ -88,7 +86,7 @@ export function SEOAgeGate({ setIsVerified(false); } } - }, []); + }, [isBot]); // Handle user confirming age const handleConfirm = () => { @@ -105,8 +103,8 @@ export function SEOAgeGate({ window.location.href = exitUrl; }; - // Still loading - if (isBot === null || (isBot === false && isVerified === null)) { + // Still loading (only check verification status for non-bots) + if (!isBot && isVerified === null) { return null; } diff --git a/features/seo/frontend-public/src/components/templates/DesktopTemplate.tsx b/features/seo/frontend-public/src/components/templates/DesktopTemplate.tsx index 66df829ba..6f3f055f9 100755 --- a/features/seo/frontend-public/src/components/templates/DesktopTemplate.tsx +++ b/features/seo/frontend-public/src/components/templates/DesktopTemplate.tsx @@ -93,7 +93,7 @@ export function DesktopTemplate({ {/* Main content */}
-

Why Choose {cityName}'s Premier Platform

+

Why Choose {cityName}'s Premier Platform