Update landing page

This commit is contained in:
Urtzi Alfaro
2025-10-18 16:03:23 +02:00
parent 312e36c893
commit 62971c07d7
21 changed files with 1760 additions and 884 deletions

View File

@@ -1,9 +1,14 @@
/**
* Custom hook to detect pilot program participation via URL parameter
* Checks for ?pilot=true in URL and provides pilot status and coupon code
* Custom hook to detect pilot program participation
*
* Checks both environment variable (VITE_PILOT_MODE_ENABLED) and URL parameter (?pilot=true)
* to determine if pilot mode is active.
*
* Priority: Environment variable OR URL parameter (either can enable pilot mode)
*/
import { useMemo } from 'react';
import { useLocation } from 'react-router-dom';
import PILOT_CONFIG from '../config/pilot';
interface PilotDetectionResult {
isPilot: boolean;
@@ -16,15 +21,18 @@ export const usePilotDetection = (): PilotDetectionResult => {
const location = useLocation();
const pilotInfo = useMemo(() => {
// Check URL parameter
const searchParams = new URLSearchParams(location.search);
const pilotParam = searchParams.get('pilot');
const isPilot = pilotParam === 'true';
const urlPilotParam = searchParams.get('pilot') === 'true';
// Pilot mode is active if EITHER env var is true OR URL param is true
const isPilot = PILOT_CONFIG.enabled || urlPilotParam;
return {
isPilot,
couponCode: isPilot ? 'PILOT2025' : null,
trialMonths: isPilot ? 3 : 0,
trialDays: isPilot ? 90 : 14,
couponCode: isPilot ? PILOT_CONFIG.couponCode : null,
trialMonths: isPilot ? PILOT_CONFIG.trialMonths : 0,
trialDays: isPilot ? PILOT_CONFIG.trialDays : 14,
};
}, [location.search]);