diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 13217b3..ae48061 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -61,6 +61,7 @@ const VerifyEmail = React.lazy(() => import('./pages/VerifyEmail')); const EmailVerificationRequired = React.lazy(() => import('./pages/EmailVerificationRequired')); const AcceptInvitePage = React.lazy(() => import('./pages/AcceptInvitePage')); const TenantOnboardPage = React.lazy(() => import('./pages/TenantOnboardPage')); +const TenantLandingPage = React.lazy(() => import('./pages/TenantLandingPage')); const Tickets = React.lazy(() => import('./pages/Tickets')); // Import Tickets page const HelpGuide = React.lazy(() => import('./pages/HelpGuide')); // Import Platform Guide page const HelpTicketing = React.lazy(() => import('./pages/HelpTicketing')); // Import Help page for ticketing @@ -287,29 +288,40 @@ const AppContent: React.FC = () => { ); } - // Not authenticated - redirect to root domain for login if on subdomain + // Not authenticated - show appropriate page based on subdomain if (!user) { - // If on a subdomain, redirect to root domain login page const currentHostname = window.location.hostname; const hostnameParts = currentHostname.split('.'); const baseDomain = hostnameParts.length >= 2 ? hostnameParts.slice(-2).join('.') : currentHostname; const isRootDomainForUnauthUser = currentHostname === baseDomain || currentHostname === 'localhost'; + const isPlatformSubdomain = hostnameParts[0] === 'platform'; + const currentSubdomain = hostnameParts[0]; - // Don't redirect for certain public paths that should work on any subdomain - const publicPaths = ['/accept-invite', '/verify-email', '/tenant-onboard']; - const currentPath = window.location.pathname; - const isPublicPath = publicPaths.some(path => currentPath.startsWith(path)); + // Check if we're on a business subdomain (not root, not platform, not api) + const isBusinessSubdomain = !isRootDomainForUnauthUser && !isPlatformSubdomain && currentSubdomain !== 'api'; - if (!isRootDomainForUnauthUser && !isPublicPath) { - // Redirect to root domain login (preserve port) - const protocol = window.location.protocol; - const port = window.location.port ? `:${window.location.port}` : ''; - window.location.href = `${protocol}//${baseDomain}${port}/login`; - return ; + // For business subdomains, show the tenant landing page with login option + if (isBusinessSubdomain) { + return ( + }> + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + ); } + // For root domain or platform subdomain, show marketing site / login return ( }> diff --git a/frontend/src/pages/TenantLandingPage.tsx b/frontend/src/pages/TenantLandingPage.tsx new file mode 100644 index 0000000..2791aae --- /dev/null +++ b/frontend/src/pages/TenantLandingPage.tsx @@ -0,0 +1,96 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import { Calendar, Clock, ArrowRight, Building2 } from 'lucide-react'; + +interface TenantLandingPageProps { + subdomain: string; +} + +const TenantLandingPage: React.FC = ({ subdomain }) => { + // Format subdomain for display (capitalize first letter, replace hyphens with spaces) + const displayName = subdomain + .split('-') + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); + + return ( +
+ {/* Header */} +
+
+
+
+
+ +
+ + {displayName} + +
+ + Sign In + + +
+
+
+ + {/* Main Content */} +
+
+ {/* Icon */} +
+
+ +
+
+ + {/* Title */} +

+ {displayName} +

+ + {/* Coming Soon Badge */} +
+ + Coming Soon +
+ + {/* Description */} +

+ We're setting up our online booking system. Check back soon to schedule your appointment! +

+ + {/* CTA Buttons */} +
+ + Staff Login + + +
+ + {/* Powered by */} +

+ Powered by{' '} + + SmoothSchedule + +

+
+
+
+ ); +}; + +export default TenantLandingPage;