mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Merge pull request #496 from chriswritescode-dev/fix/ios-pwa-status-bar
fix(frontend): paint the iOS PWA status bar and keep it filled
This commit is contained in:
4 files changed
+12
-5
No files matched your search
@@ -143,6 +143,7 @@ function RootLayout() {
|
||||
<QueryCachePersistenceProvider>
|
||||
<ThemeProvider>
|
||||
<TTSProvider>
|
||||
<div aria-hidden="true" className="pointer-events-none fixed inset-x-0 top-0 z-40 h-[max(env(safe-area-inset-top),0.75rem)] md:h-[env(safe-area-inset-top)] bg-background" />
|
||||
<ThemedToaster />
|
||||
<Outlet />
|
||||
</TTSProvider>
|
||||
|
||||
@@ -95,7 +95,7 @@ describe('DialogContent', () => {
|
||||
</Dialog>,
|
||||
)
|
||||
const content = screen.getByTestId('dialog-content')
|
||||
expect(content).toHaveStyle({ paddingTop: 'env(safe-area-inset-top, 0px)' })
|
||||
expect(content).toHaveStyle({ paddingTop: 'var(--safe-area-top)' })
|
||||
expect(content).toHaveClass('inset-0')
|
||||
},
|
||||
)
|
||||
|
||||
@@ -109,7 +109,7 @@ const DialogContent = React.forwardRef<
|
||||
}, [shouldEnableMobileSwipe, swipeBind, swipeContainer])
|
||||
|
||||
const baseStyle = isMobileFullscreenMode
|
||||
? { paddingTop: 'env(safe-area-inset-top, 0px)' }
|
||||
? { paddingTop: 'var(--safe-area-top)' }
|
||||
: undefined
|
||||
|
||||
const mergedStyle = {
|
||||
@@ -153,7 +153,7 @@ const DialogContent = React.forwardRef<
|
||||
<DialogPrimitive.Close
|
||||
className="absolute right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground after:absolute after:-inset-2 after:content-[''] pointer-coarse:after:-inset-3.5"
|
||||
style={mobileFullscreen ? {
|
||||
top: 'calc(env(safe-area-inset-top, 0px) + 1rem)',
|
||||
top: 'calc(var(--safe-area-top) + 1rem)',
|
||||
} : { top: '1rem' }}
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
|
||||
@@ -96,6 +96,13 @@
|
||||
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--safe-area-top: calc(env(safe-area-inset-top) + min(env(safe-area-inset-top), 1rem));
|
||||
}
|
||||
|
||||
@media (width < 48rem) {
|
||||
:root {
|
||||
--safe-area-top: max(calc(env(safe-area-inset-top) + min(env(safe-area-inset-top), 1rem)), 0.75rem);
|
||||
}
|
||||
}
|
||||
|
||||
:root:not(.dark) {
|
||||
@@ -373,8 +380,7 @@ body {
|
||||
}
|
||||
|
||||
@utility pt-safe {
|
||||
padding-top: constant(safe-area-inset-top);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
padding-top: var(--safe-area-top);
|
||||
}
|
||||
|
||||
@utility pb-safe {
|
||||
|
||||
Reference in new issue
Block a user