From a9e8d6fe2de901f2e40816c9cc81dbe2e540acf1 Mon Sep 17 00:00:00 2001 From: Desktop Date: Thu, 13 Nov 2025 18:42:53 +0500 Subject: [PATCH] fixes for site --- frontend/package.json | 1 + .../src/marketing/components/HeroSection.tsx | 43 +++++++++++------ frontend/src/marketing/pages/Tour.tsx | 6 +-- frontend/vite.config.ts | 46 ++++++++++--------- 4 files changed, 59 insertions(+), 37 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 396522d8..9eaab3e1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "vite build", + "build:marketing": "vite build --mode marketing", "build:check": "tsc -b && vite build", "type-check": "tsc -b --noEmit", "lint": "eslint .", diff --git a/frontend/src/marketing/components/HeroSection.tsx b/frontend/src/marketing/components/HeroSection.tsx index 335f5414..16d3fc5a 100644 --- a/frontend/src/marketing/components/HeroSection.tsx +++ b/frontend/src/marketing/components/HeroSection.tsx @@ -16,6 +16,29 @@ const HeroSection: React.FC = ({ primaryCta, secondaryCta, }) => { + const renderCta = (cta: { label: string; href: string }, className: string) => { + const isExternal = cta.href.startsWith("http"); + + if (isExternal) { + return ( + + {cta.label} + + ); + } + + return ( + + {cta.label} + + ); + }; + return (
@@ -31,19 +54,13 @@ const HeroSection: React.FC = ({ {subheadline}

- - {primaryCta.label} - - {secondaryCta && ( - - {secondaryCta.label} - + {renderCta( + primaryCta, + "inline-flex items-center justify-center rounded-full bg-brand-500 hover:bg-brand-400 px-6 py-3 text-sm md:text-base font-semibold transition" + )} + {secondaryCta && renderCta( + secondaryCta, + "inline-flex items-center justify-center rounded-full border border-white/20 px-6 py-3 text-sm md:text-base font-semibold text-white/80 hover:text-white hover:border-white/40 transition" )}
diff --git a/frontend/src/marketing/pages/Tour.tsx b/frontend/src/marketing/pages/Tour.tsx index 64aa51b2..b37cedb6 100644 --- a/frontend/src/marketing/pages/Tour.tsx +++ b/frontend/src/marketing/pages/Tour.tsx @@ -49,16 +49,16 @@ const Tour: React.FC = () => { {tourSteps.map((step, index) => (
-
+
Step {index + 1}

{step.title}

{step.description}

-
+
{step.title} { const isDev = mode === "development"; + const isMarketingBuild = mode === "marketing"; return { plugins: [ @@ -23,27 +24,26 @@ export default defineConfig(({ mode }) => { optimizeDeps: { include: [ // Only pre-bundle frequently used, small dependencies - 'clsx', - 'tailwind-merge', - 'zustand', - // Include apexcharts for proper module resolution - 'apexcharts', - 'react-apexcharts', + "clsx", + "tailwind-merge", + "zustand", + // Include apexcharts for proper module resolution (skip during marketing-only build) + ...(isMarketingBuild ? [] : ["apexcharts", "react-apexcharts"]), ], // Exclude heavy dependencies that are only used in specific pages // They will be lazy-loaded when needed exclude: [ - '@fullcalendar/core', - '@fullcalendar/daygrid', - '@fullcalendar/interaction', - '@fullcalendar/list', - '@fullcalendar/react', - '@fullcalendar/timegrid', - '@react-jvectormap/core', - '@react-jvectormap/world', - 'react-dnd', - 'react-dnd-html5-backend', - 'swiper', + "@fullcalendar/core", + "@fullcalendar/daygrid", + "@fullcalendar/interaction", + "@fullcalendar/list", + "@fullcalendar/react", + "@fullcalendar/timegrid", + "@react-jvectormap/core", + "@react-jvectormap/world", + "react-dnd", + "react-dnd-html5-backend", + "swiper", ], esbuildOptions: { target: 'es2020', @@ -57,10 +57,14 @@ export default defineConfig(({ mode }) => { cssCodeSplit: true, // Optimize chunk size rollupOptions: { - input: { - main: resolve(__dirname, "index.html"), - marketing: resolve(__dirname, "marketing.html"), - }, + input: isMarketingBuild + ? { + marketing: resolve(__dirname, "marketing.html"), + } + : { + main: resolve(__dirname, "index.html"), + marketing: resolve(__dirname, "marketing.html"), + }, output: { // Manual chunk splitting for better code splitting manualChunks: (id) => {