From d9c4aec2386c3a92d0cb0a14cd58e7e9d019a93f Mon Sep 17 00:00:00 2001 From: nelly439 Date: Thu, 22 Oct 2026 17:29:06 +0100 Subject: [PATCH 1/6] chore: upgrade replace ad hoc axios usage with Route application HTTP requests through a single Axios client with authentication and unauthorized-response interceptors.\n\nPreserve existing API entry points as compatibility exports, migrate service and hook call sites, and cover the interceptor pipeline. Also repair the existing MobileFooter syntax error that initially blocked type checking. --- components/mobile/MobileFooter.tsx | 34 +++++++++---------- features/auth/lib/axios.ts | 9 +---- hooks/useCallToAction.ts | 4 +-- hooks/useFleet.ts | 4 +-- hooks/useIndustryHero.ts | 4 +-- hooks/useKineticExplorer.ts | 4 +-- hooks/usePricingComparison.ts | 4 +-- hooks/useSettlementDiagram.ts | 4 +-- hooks/useTestimonial.ts | 4 +-- hooks/useTrustBar.ts | 4 +-- hooks/useValueProps.ts | 4 +-- lib/__tests__/httpClient.test.ts | 38 +++++++++++++++++++++ lib/api.ts | 42 +---------------------- lib/httpClient.ts | 54 ++++++++++++++++++++++++++++++ lib/toast.ts | 2 +- services/api.ts | 11 +----- services/authService.ts | 2 +- services/breadcrumbService.ts | 2 +- services/commandPaletteService.ts | 2 +- services/contactService.ts | 4 +-- services/contractMockupService.ts | 2 +- services/ctaService.ts | 2 +- services/currencyRateService.ts | 2 +- services/driverJobService.ts | 4 +-- services/faqService.ts | 4 +-- services/feeService.ts | 2 +- services/fleetService.ts | 2 +- services/footerService.ts | 2 +- services/industryService.ts | 2 +- services/iotDashboardService.ts | 2 +- services/kineticExplorerService.ts | 2 +- services/kycService.ts | 2 +- services/landingService.ts | 2 +- services/layoutService.ts | 2 +- services/modalService.ts | 2 +- services/notificationService.ts | 4 +-- services/pricingService.ts | 2 +- services/proofService.ts | 2 +- services/registrationService.ts | 2 +- services/settlementService.ts | 2 +- services/shipmentService.ts | 2 +- services/testimonialService.ts | 2 +- services/themeService.ts | 2 +- services/trackingService.ts | 8 ++--- services/trustBarService.ts | 2 +- services/userService.ts | 2 +- services/valuePropsService.ts | 2 +- 47 files changed, 168 insertions(+), 134 deletions(-) create mode 100644 lib/__tests__/httpClient.test.ts create mode 100644 lib/httpClient.ts diff --git a/components/mobile/MobileFooter.tsx b/components/mobile/MobileFooter.tsx index 303e290a..6737f3f5 100644 --- a/components/mobile/MobileFooter.tsx +++ b/components/mobile/MobileFooter.tsx @@ -1,26 +1,25 @@ -`use client +"use client" -import React from react -import Link from next/link +import Link from 'next/link' // Navigation links data const footerLinks = [ - { label: Home, href: / }, - { label: About, href: /about }, - { label: Services, href: /services }, - { label: Support, href: /support }, - { label: Privacy Policy, href: /privacy }, - { label: Terms of Service, href: /terms }, - { label: Contact, href: /contact }, - { label: FAQs, href: /faq }, + { label: 'Home', href: '/' }, + { label: 'About', href: '/about' }, + { label: 'Services', href: '/services' }, + { label: 'Support', href: '/support' }, + { label: 'Privacy Policy', href: '/privacy' }, + { label: 'Terms of Service', href: '/terms' }, + { label: 'Contact', href: '/contact' }, + { label: 'FAQs', href: '/faq' }, ] // Social icons data const socialLinks = [ - { label: Twitter, href: https://twitter.com/swiftchain, icon: 🐦 }, - { label: GitHub, href: https://github.com/swiftchain, icon: 🐙 }, - { label: LinkedIn, href: https://linkedin.com/company/swiftchain, icon: 🔗 }, - { label: Discord, href: https://discord.gg/swiftchain, icon: 💬 }, + { label: 'Twitter', href: 'https://twitter.com/swiftchain', icon: '🐦' }, + { label: 'GitHub', href: 'https://github.com/swiftchain', icon: '🐙' }, + { label: 'LinkedIn', href: 'https://linkedin.com/company/swiftchain', icon: '🔗' }, + { label: 'Discord', href: 'https://discord.gg/swiftchain', icon: '💬' }, ] export function MobileFooter() { @@ -36,7 +35,7 @@ export function MobileFooter() { key={link.href} href={link.href} className="rounded-lg px-3 py-2.5 text-sm text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-100 dark:active:bg-gray-700" - style={{ minHeight: 44px }} + style={{ minHeight: '44px' }} > {link.label} @@ -53,7 +52,7 @@ export function MobileFooter() { rel="noopener noreferrer" className="flex h-11 w-11 items-center justify-center rounded-full text-xl transition-colors hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-100" aria-label={social.label} - style={{ minHeight: 44px, minWidth: 44px }} + style={{ minHeight: '44px', minWidth: '44px' }} > {social.label}