Skip to content

Commit 2d0f776

Browse files
authored
Merge pull request #21 from eurosky-social/eurosky/fork
add safe area insets
2 parents f624d0b + 59523f4 commit 2d0f776

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/view/com/home/HomeHeaderLayoutMobile.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {Hashtag_Stroke2_Corner0_Rounded as FeedsIcon} from '#/components/icons/H
2020
import * as Layout from '#/components/Layout'
2121
import {Link} from '#/components/Link'
2222
import {useAnalytics} from '#/analytics'
23-
import {IS_DEV, IS_LIQUID_GLASS} from '#/env'
23+
import {IS_DEV, IS_LIQUID_GLASS, IS_WEB} from '#/env'
2424

2525
export function HomeHeaderLayoutMobile({
2626
children,
@@ -49,7 +49,10 @@ export function HomeHeaderLayoutMobile({
4949
left: 0,
5050
right: 0,
5151
},
52-
IS_LIQUID_GLASS && {paddingTop: insets.top},
52+
// Eurosky fork: the home header is position:fixed at top:0, so on web
53+
// (incl. standalone PWA) it must pad past the notch/Dynamic Island.
54+
// Other screens get this via Layout.Screen; the fixed home header does not.
55+
(IS_LIQUID_GLASS || IS_WEB) && {paddingTop: insets.top},
5356
headerMinimalShellTransform,
5457
]}
5558
onLayout={e => {

src/view/shell/bottom-bar/BottomBarWeb.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {useCallback} from 'react'
22
import {View} from 'react-native'
33
import Animated from 'react-native-reanimated'
4+
import {useSafeAreaInsets} from 'react-native-safe-area-context'
45
import {msg, plural} from '@lingui/core/macro'
56
import {useLingui} from '@lingui/react'
67
import {Trans} from '@lingui/react/macro'
@@ -52,6 +53,9 @@ export function BottomBarWeb() {
5253
const {_} = useLingui()
5354
const {hasSession, currentAccount} = useSession()
5455
const t = useTheme()
56+
// Eurosky fork: pad the bottom bar past the iOS home indicator when running
57+
// as a standalone PWA (env(safe-area-inset-bottom)); 0 in a browser tab.
58+
const insets = useSafeAreaInsets()
5559
const footerMinimalShellTransform = useMinimalShellFooterTransform()
5660
const {requestSwitchToAccount} = useLoggedOutViewControls()
5761
const closeAllActiveElements = useCloseAllActiveElements()
@@ -90,6 +94,7 @@ export function BottomBarWeb() {
9094
styles.bottomBar,
9195
styles.bottomBarWeb,
9296
t.atoms.bg,
97+
{paddingBottom: insets.bottom},
9398
hideBorder
9499
? {borderColor: t.atoms.bg.backgroundColor}
95100
: t.atoms.border_contrast_low,

0 commit comments

Comments
 (0)