From aa8d52e5e49d03a4a0d0ccd4c548561fc533c53a Mon Sep 17 00:00:00 2001 From: Michilis <120072772+Michilis@users.noreply.github.com> Date: Sun, 9 Feb 2025 22:17:46 +0100 Subject: [PATCH] Add files via upload --- src/components/Layout.tsx | 15 ++++++++++++++- src/components/Navigation.tsx | 22 +++++++++++++++------- src/pages/Dashboard.tsx | 27 +++++++++++++++++++++++---- src/pages/Home.tsx | 6 ++++-- src/pages/Login.tsx | 14 +++++++------- src/pages/Payment.tsx | 13 +++++++------ src/pages/Terms.tsx | 3 +++ src/pages/ThankYou.tsx | 11 ++++++----- 8 files changed, 79 insertions(+), 32 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 0cf129f..2cbe053 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,8 +1,21 @@ import React from 'react'; -import { Link, Outlet } from 'react-router-dom'; +import { Link, Outlet, useSearchParams } from 'react-router-dom'; import { Navigation } from './Navigation'; export function Layout() { + const [searchParams] = useSearchParams(); + const isIframe = searchParams.get('iframe') === '1'; + + if (isIframe) { + return ( +
+
+ +
+
+ ); + } + return (
diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 44d369f..10e7f90 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -1,18 +1,21 @@ import React, { useState } from 'react'; -import { Link, useLocation, useNavigate } from 'react-router-dom'; +import { Link, useLocation, useNavigate, useSearchParams } from 'react-router-dom'; import { Flame, Menu, X } from 'lucide-react'; import { useStore } from '../store/useStore'; export function Navigation() { const location = useLocation(); const navigate = useNavigate(); + const [searchParams] = useSearchParams(); const { user, setUser } = useStore(); const [isMenuOpen, setIsMenuOpen] = useState(false); + const isIframe = searchParams.get('iframe') === '1'; const handleLogout = () => { setUser(null); setIsMenuOpen(false); - navigate('/login', { replace: true }); // Use replace to prevent going back to dashboard + const newPath = '/login' + (isIframe ? '?iframe=1' : ''); + navigate(newPath, { replace: true }); }; const handleMenuClick = () => { @@ -23,11 +26,16 @@ export function Navigation() { setIsMenuOpen(false); }; + // Helper function to add iframe parameter to paths + const getPath = (path: string) => { + return isIframe ? `${path}?iframe=1` : path; + }; + return (