mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-03 23:02:31 +08:00
Merge pull request #13 from DayuanJiang/fix/resize
fix: Preserve state when resizing window to mobile size
This commit is contained in:
11
app/page.tsx
11
app/page.tsx
@@ -40,20 +40,19 @@ export default function Home() {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (isMobile) {
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center h-screen bg-gray-100">
|
<div className="flex h-screen bg-gray-100 relative">
|
||||||
|
{/* Mobile warning overlay - keeps components mounted */}
|
||||||
|
{isMobile && (
|
||||||
|
<div className="absolute inset-0 z-50 flex items-center justify-center bg-gray-100">
|
||||||
<div className="text-center p-8">
|
<div className="text-center p-8">
|
||||||
<h1 className="text-2xl font-semibold text-gray-800">
|
<h1 className="text-2xl font-semibold text-gray-800">
|
||||||
Please open this application on a desktop or laptop
|
Please open this application on a desktop or laptop
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
)}
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="flex h-screen bg-gray-100">
|
|
||||||
<div className={`${isChatVisible ? 'w-2/3' : 'w-full'} p-1 h-full relative transition-all duration-300 ease-in-out`}>
|
<div className={`${isChatVisible ? 'w-2/3' : 'w-full'} p-1 h-full relative transition-all duration-300 ease-in-out`}>
|
||||||
<DrawIoEmbed
|
<DrawIoEmbed
|
||||||
ref={drawioRef}
|
ref={drawioRef}
|
||||||
|
|||||||
Reference in New Issue
Block a user