Skip to content

Commit 96696b3

Browse files
committed
Fixes the composer on iOS showing behind the liquid glass nav
Changelog: fix
1 parent fffc4cd commit 96696b3

13 files changed

Lines changed: 649 additions & 389 deletions

File tree

apps/polycentric/app/(tabs)/_layout.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useTheme } from '@/src/common/theme';
2-
import { isWeb } from '@/src/common/util/platform';
2+
import { isIOS, isWeb } from '@/src/common/util/platform';
33
import { Slot } from 'expo-router';
44
import { NativeTabs } from 'expo-router/unstable-native-tabs';
55

@@ -11,6 +11,7 @@ export default function TabsLayout() {
1111

1212
return (
1313
<NativeTabs
14+
backBehavior="history"
1415
minimizeBehavior="onScrollDown"
1516
backgroundColor={theme.palette.neutral_0}
1617
iconColor={theme.palette.neutral_900}
@@ -33,6 +34,16 @@ export default function TabsLayout() {
3334
<NativeTabs.Trigger.Label>Activity</NativeTabs.Trigger.Label>
3435
<NativeTabs.Trigger.Icon sf="bell.fill" md="notifications" />
3536
</NativeTabs.Trigger>
37+
38+
{isIOS ? (
39+
<NativeTabs.Trigger name="compose" role="search">
40+
<NativeTabs.Trigger.Label hidden>Compose</NativeTabs.Trigger.Label>
41+
<NativeTabs.Trigger.Icon
42+
sf={{ default: 'square.and.pencil', selected: 'square.and.pencil' }}
43+
md="edit"
44+
/>
45+
</NativeTabs.Trigger>
46+
) : null}
3647
</NativeTabs>
3748
);
3849
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from '@/src/features/composer/ComposeScreen';
1+
export { default } from '@/src/features/composer/ComposeTabScreen';

apps/polycentric/src/common/components/composites/Fab.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ export function Fab({ onPress, icon, title = '' }: FabProps) {
2121
const shadow =
2222
Platform.OS === 'web'
2323
? {
24-
boxShadow: `0 6px 16px ${withHexOpacity(
25-
theme.palette.primary_900,
26-
isLight ? '28' : '40',
27-
)}`,
28-
}
24+
boxShadow: `0 6px 16px ${withHexOpacity(
25+
theme.palette.primary_900,
26+
isLight ? '28' : '40',
27+
)}`,
28+
}
2929
: {
30-
shadowColor: theme.palette.primary_900,
31-
shadowOpacity: isLight ? 0.16 : 0.26,
32-
shadowRadius: isLight ? 14 : 10,
33-
shadowOffset: { width: 0, height: isLight ? 3 : 4 },
34-
elevation: isLight ? 4 : 6,
35-
};
30+
shadowColor: theme.palette.primary_900,
31+
shadowOpacity: isLight ? 0.16 : 0.26,
32+
shadowRadius: isLight ? 14 : 10,
33+
shadowOffset: { width: 0, height: isLight ? 3 : 4 },
34+
elevation: isLight ? 4 : 6,
35+
};
3636

3737
return (
3838
<View style={[Atoms.absolute, { bottom: 0, right: 0 }, Atoms.p_lg]}>

apps/polycentric/src/common/components/layout/Layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Atoms, Breakpoints, typography, useTheme } from '@/src/common/theme';
2-
import { isWeb } from '@/src/common/util/platform';
2+
import { isIOS, isWeb } from '@/src/common/util/platform';
33
import { Image } from 'expo-image';
44
import { ExternalPathString, Link } from 'expo-router';
55
import {
@@ -80,13 +80,15 @@ type PrimaryColumnProps = {
8080
function PrimaryColumn({ children }: PrimaryColumnProps) {
8181
const { theme } = useTheme();
8282
const { height: windowHeight } = useWindowDimensions();
83+
const insets = useSafeAreaInsets();
8384

8485
return (
8586
<View
8687
testID="primaryColumn"
8788
style={[
8889
Atoms.flex_1,
8990
isWeb && Atoms.pb_lg,
91+
!isWeb && { paddingBottom: insets.bottom },
9092
isWeb && {
9193
maxWidth: 600,
9294
borderLeftColor: theme.palette.neutral_25,

apps/polycentric/src/common/theme/tokens.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ export const Atoms = StyleSheet.create({
405405
pb_3xl: {
406406
paddingBottom: Spacing['3xl'],
407407
},
408+
pb_4xl: {
409+
paddingBottom: Spacing['4xl'],
410+
},
408411

409412
pl_0: {
410413
paddingLeft: Spacing['0'],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import { Platform } from 'react-native';
22

33
export const isWeb = Platform.OS === 'web';
4+
export const isIOS = Platform.OS === 'ios';

0 commit comments

Comments
 (0)