From 418b72178326c38fd429fcfcc97bba9e258ab03e Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Mon, 11 Aug 2025 14:18:47 -0700 Subject: [PATCH] mobile --- frontend/src/app/layout.tsx | 1 + .../components/home/sections/hero-section.tsx | 58 ++++++++++--------- .../src/components/home/sections/navbar.tsx | 25 ++++---- .../thread/preview-renderers/pdf-renderer.tsx | 57 +++++++++++++----- frontend/src/lib/polyfills.ts | 21 +++++++ package-lock.json | 6 ++ 6 files changed, 114 insertions(+), 54 deletions(-) create mode 100644 frontend/src/lib/polyfills.ts create mode 100644 package-lock.json diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 8bdecd70..c0dca12e 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -10,6 +10,7 @@ import { GoogleAnalytics } from '@next/third-parties/google'; import { SpeedInsights } from '@vercel/speed-insights/next'; import Script from 'next/script'; import { PostHogIdentify } from '@/components/posthog-identify'; +import '@/lib/polyfills'; // Load polyfills early const geistSans = Geist({ variable: '--font-geist-sans', diff --git a/frontend/src/components/home/sections/hero-section.tsx b/frontend/src/components/home/sections/hero-section.tsx index 8b38bc80..a889834a 100644 --- a/frontend/src/components/home/sections/hero-section.tsx +++ b/frontend/src/components/home/sections/hero-section.tsx @@ -233,9 +233,9 @@ export function HeroSection() { return (
-
+
{/* Left side flickering grid with gradient fades */} -
+
{/* Horizontal fade from left to right */}
@@ -245,18 +245,20 @@ export function HeroSection() { {/* Vertical fade to bottom */}
- + {mounted && ( + + )}
{/* Right side flickering grid with gradient fades */} -
+
{/* Horizontal fade from right to left */}
@@ -266,20 +268,22 @@ export function HeroSection() { {/* Vertical fade to bottom */}
- + {mounted && ( + + )}
{/* Center content background with rounded bottom */} -
+
-
+
{/*

{hero.badgeIcon} {hero.badge} @@ -314,17 +318,17 @@ export function HeroSection() { */} -

-

+
+

Build, manage and train your AI Workforce.

-

+

Kortix – the simplest way to migrate from human to AI.

-
+
- +
-
+
{/* Auth Dialog */} diff --git a/frontend/src/components/home/sections/navbar.tsx b/frontend/src/components/home/sections/navbar.tsx index 10e49d46..63bf71dc 100644 --- a/frontend/src/components/home/sections/navbar.tsx +++ b/frontend/src/components/home/sections/navbar.tsx @@ -113,8 +113,8 @@ export function Navbar() { return (
-
+
{/* Left Section - Logo */} -
+
Kortix Logo
{/* Center Section - Navigation Menu */} -
+
{/* Right Section - Actions */} -
-
+
+
{ + const { Document, Page, pdfjs } = require('react-pdf'); + + // Configure PDF.js worker + React.useEffect(() => { + pdfjs.GlobalWorkerOptions.workerSrc = new URL( + 'pdfjs-dist/build/pdf.worker.min.mjs', + import.meta.url, + ).toString(); + }, [pdfjs]); + + return ( + + + + ); +}; + +// Dynamic import to avoid SSR issues +const DynamicPdfDocument = dynamic(() => Promise.resolve(PdfDocument), { + ssr: false, + loading: () => ( +
+
Loading PDF...
+
+ ) +}); interface PdfRendererProps { url?: string | null; @@ -43,15 +78,7 @@ export function PdfRenderer({ url, className }: PdfRendererProps) { return (
- - - +
); diff --git a/frontend/src/lib/polyfills.ts b/frontend/src/lib/polyfills.ts new file mode 100644 index 00000000..20090c47 --- /dev/null +++ b/frontend/src/lib/polyfills.ts @@ -0,0 +1,21 @@ +// Polyfill for Promise.withResolvers (Node.js 21+ feature) +// This is needed for react-pdf compatibility with Node.js 20 +if (!Promise.withResolvers) { + Promise.withResolvers = function (): { + promise: Promise; + resolve: (value: T | PromiseLike) => void; + reject: (reason?: any) => void; + } { + let resolve: (value: T | PromiseLike) => void; + let reject: (reason?: any) => void; + + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + + return { promise, resolve: resolve!, reject: reject! }; + }; +} + +export {}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..79a37bba --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "agentpress", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}