fix: adjust layout styles for better responsiveness
This commit is contained in:
@@ -342,14 +342,14 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
|
|||||||
>
|
>
|
||||||
<CurrentRelaysProvider>
|
<CurrentRelaysProvider>
|
||||||
<NotificationProvider>
|
<NotificationProvider>
|
||||||
<div className="flex h-screen overflow-hidden bg-surface-background">
|
<div className="flex h-[var(--vh)] overflow-hidden bg-surface-background">
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
<div className="grid grid-cols-2 gap-2 w-full pr-2">
|
<div className="grid grid-cols-2 gap-2 w-full pr-2 py-2">
|
||||||
<div className="flex rounded-lg my-2 max-h-screen shadow-md bg-background overflow-hidden">
|
<div className="rounded-lg shadow-lg bg-background overflow-hidden">
|
||||||
{primaryPages.map(({ name, element, props }) => (
|
{primaryPages.map(({ name, element, props }) => (
|
||||||
<div
|
<div
|
||||||
key={name}
|
key={name}
|
||||||
className="w-full"
|
className="flex flex-col h-full w-full"
|
||||||
style={{
|
style={{
|
||||||
display: currentPrimaryPage === name ? 'block' : 'none'
|
display: currentPrimaryPage === name ? 'block' : 'none'
|
||||||
}}
|
}}
|
||||||
@@ -358,11 +358,11 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex rounded-lg my-2 max-h-screen shadow-md bg-background overflow-hidden">
|
<div className="rounded-lg shadow-lg bg-background overflow-hidden">
|
||||||
{secondaryStack.map((item, index) => (
|
{secondaryStack.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
key={item.index}
|
key={item.index}
|
||||||
className="w-full"
|
className="flex flex-col h-full w-full"
|
||||||
style={{ display: index === secondaryStack.length - 1 ? 'block' : 'none' }}
|
style={{ display: index === secondaryStack.length - 1 ? 'block' : 'none' }}
|
||||||
>
|
>
|
||||||
{item.component}
|
{item.component}
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ import { createRoot } from 'react-dom/client'
|
|||||||
import App from './App.tsx'
|
import App from './App.tsx'
|
||||||
import { ErrorBoundary } from './components/ErrorBoundary.tsx'
|
import { ErrorBoundary } from './components/ErrorBoundary.tsx'
|
||||||
|
|
||||||
|
const setVh = () => {
|
||||||
|
document.documentElement.style.setProperty('--vh', `${window.innerHeight}px`)
|
||||||
|
}
|
||||||
|
window.addEventListener('resize', setVh)
|
||||||
|
window.addEventListener('orientationchange', setVh)
|
||||||
|
setVh()
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
|||||||
Reference in New Issue
Block a user