fix: conditionally render OfflineBanner and adjust main padding based on user authentication and online status
This commit is contained in:
@@ -55,9 +55,9 @@ export default function LayoutContent({ children }: { children: React.ReactNode
|
|||||||
showFaq={false}
|
showFaq={false}
|
||||||
showSecurity={false}
|
showSecurity={false}
|
||||||
showPricing={true}
|
showPricing={true}
|
||||||
bottomContent={<OfflineBanner />}
|
bottomContent={auth.user ? <OfflineBanner /> : undefined}
|
||||||
/>
|
/>
|
||||||
<main className={`flex-1 pb-8 ${isOnline ? 'pt-24' : 'pt-32'}`}>
|
<main className={`flex-1 pb-8 ${auth.user && !isOnline ? 'pt-32' : 'pt-24'}`}>
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
<Footer
|
<Footer
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function OfflineBanner() {
|
|||||||
if (isOnline) return null;
|
if (isOnline) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-yellow-500/10 dark:bg-yellow-500/20 border-b border-yellow-500/20 dark:border-yellow-500/30 text-yellow-600 dark:text-yellow-400 px-4 sm:px-8 py-2 text-sm flex items-center justify-center gap-2 font-medium">
|
<div className="rounded-b-2xl bg-yellow-500/10 dark:bg-yellow-500/20 border-b border-yellow-500/20 dark:border-yellow-500/30 text-yellow-600 dark:text-yellow-400 px-4 sm:px-8 py-2 text-sm flex items-center justify-center gap-2 font-medium">
|
||||||
<FiWifiOff className="w-4 h-4" />
|
<FiWifiOff className="w-4 h-4" />
|
||||||
<span>You are currently offline. Changes may not be saved.</span>
|
<span>You are currently offline. Changes may not be saved.</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user