diff --git a/frontend/src/components/domain-warning/domain-warning.tsx b/frontend/src/components/domain-warning/domain-warning.tsx index 10c836e..dfa061d 100644 --- a/frontend/src/components/domain-warning/domain-warning.tsx +++ b/frontend/src/components/domain-warning/domain-warning.tsx @@ -28,7 +28,7 @@ export const DomainWarning = (props: Props) => { diff --git a/frontend/src/components/layout/layout.tsx b/frontend/src/components/layout/layout.tsx index e14e015..0ed0b39 100644 --- a/frontend/src/components/layout/layout.tsx +++ b/frontend/src/components/layout/layout.tsx @@ -4,10 +4,8 @@ import { Outlet } from "react-router"; import { useState } from "react"; import { DomainWarning } from "../domain-warning/domain-warning"; -export const Layout = () => { - const { backgroundImage, appUrl } = useAppContext(); - const [ignoreDomainWarning, setIgnoreDomainWarning] = useState(false); - const currentUrl = window.location.origin; +const BaseLayout = ({ children }: { children: React.ReactNode }) => { + const { backgroundImage } = useAppContext(); return (
{ }} > - {appUrl !== currentUrl && !ignoreDomainWarning ? ( - setIgnoreDomainWarning(true)} - appUrl={appUrl} - currentUrl={currentUrl} - /> - ) : ( - - )} + {children}
); }; + +export const Layout = () => { + const { appUrl } = useAppContext(); + const [ignoreDomainWarning, setIgnoreDomainWarning] = useState(false); + const currentUrl = window.location.origin; + const sessionIgnore = window.sessionStorage.getItem("ignoreDomainWarning"); + + const handleIgnore = () => { + window.sessionStorage.setItem("ignoreDomainWarning", "true"); + setIgnoreDomainWarning(true); + }; + + if ( + !ignoreDomainWarning && + appUrl !== currentUrl && + sessionIgnore !== "true" + ) { + return ( + + handleIgnore()} + /> + + ); + } + + return ( + + + + ); +}; diff --git a/frontend/src/index.css b/frontend/src/index.css index 0b1ee02..9701636 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -156,7 +156,7 @@ ul { } code { - @apply relative rounded bg-muted px-[0.2rem] py-[0.1rem] font-mono text-sm font-semibold; + @apply relative rounded bg-muted px-[0.2rem] py-[0.1rem] font-mono text-sm font-semibold break-all; } .lead {