Skip to content

Commit b8fe26a

Browse files
committed
fix(mobile): fix formsheet colors
1 parent 2075c33 commit b8fe26a

4 files changed

Lines changed: 27 additions & 2 deletions

File tree

‎apps/mobile/app/_layout.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ShareIntentProvider, useShareIntent } from "expo-share-intent";
1212
import { StatusBar } from "expo-status-bar";
1313
import { StyledStack } from "@/components/navigation/stack";
1414
import SplashScreenController from "@/components/SplashScreenController";
15+
import { getFormSheetSurfaceOptions } from "@/lib/form-sheet-options";
1516
import { isIOS26 } from "@/lib/ios";
1617
import { Providers } from "@/lib/providers";
1718
import { useColorScheme, useInitialAndroidBarSync } from "@/lib/useColorScheme";
@@ -34,7 +35,8 @@ export default Sentry.wrap(function RootLayout() {
3435
useInitialAndroidBarSync();
3536
const router = useRouter();
3637
const { hasShareIntent } = useShareIntent();
37-
const { colorScheme } = useColorScheme();
38+
const { colorScheme, colors } = useColorScheme();
39+
const formSheetSurfaceOptions = getFormSheetSurfaceOptions(colors.background);
3840

3941
useEffect(() => {
4042
if (hasShareIntent) {
@@ -115,6 +117,7 @@ export default Sentry.wrap(function RootLayout() {
115117
<Stack.Screen
116118
name="server-address"
117119
options={{
120+
...formSheetSurfaceOptions,
118121
title: "Server Address",
119122
headerShown: true,
120123
headerTransparent: false,
@@ -128,6 +131,7 @@ export default Sentry.wrap(function RootLayout() {
128131
<Stack.Screen
129132
name="test-connection"
130133
options={{
134+
...formSheetSurfaceOptions,
131135
title: "Test Connection",
132136
headerShown: true,
133137
headerTransparent: false,

‎apps/mobile/app/dashboard/_layout.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import { AppState, Platform } from "react-native";
44
import { useRouter } from "expo-router";
55
import { Stack } from "expo-router/stack";
66
import BookmarkListHeader from "@/components/bookmarks/BookmarkListHeader";
7+
import { getFormSheetSurfaceOptions } from "@/lib/form-sheet-options";
78
import { isIOS26 } from "@/lib/ios";
89
import { useIsLoggedIn } from "@/lib/session";
10+
import { useColorScheme } from "@/lib/useColorScheme";
911
import { focusManager } from "@tanstack/react-query";
1012

1113
function onAppStateChange(status: AppStateStatus) {
@@ -16,6 +18,8 @@ function onAppStateChange(status: AppStateStatus) {
1618

1719
export default function Dashboard() {
1820
const router = useRouter();
21+
const { colors } = useColorScheme();
22+
const formSheetSurfaceOptions = getFormSheetSurfaceOptions(colors.background);
1923

2024
const isLoggedIn = useIsLoggedIn();
2125
useEffect(() => {
@@ -73,6 +77,7 @@ export default function Dashboard() {
7377
<Stack.Screen
7478
name="bookmarks/new"
7579
options={{
80+
...formSheetSurfaceOptions,
7681
headerTitle: "New Bookmark",
7782
headerBackTitle: "Back",
7883
headerTransparent: false,
@@ -88,6 +93,7 @@ export default function Dashboard() {
8893
<Stack.Screen
8994
name="bookmarks/[slug]/manage_tags"
9095
options={{
96+
...formSheetSurfaceOptions,
9197
headerTitle: "Manage Tags",
9298
headerTransparent: false,
9399
headerLargeTitle: false,
@@ -102,6 +108,7 @@ export default function Dashboard() {
102108
<Stack.Screen
103109
name="bookmarks/[slug]/manage_lists"
104110
options={{
111+
...formSheetSurfaceOptions,
105112
headerTitle: "Manage Lists",
106113
headerTransparent: false,
107114
headerLargeTitle: false,
@@ -116,6 +123,7 @@ export default function Dashboard() {
116123
<Stack.Screen
117124
name="bookmarks/[slug]/info"
118125
options={{
126+
...formSheetSurfaceOptions,
119127
headerTitle: "Edit Bookmark",
120128
headerTransparent: false,
121129
headerLargeTitle: false,
@@ -129,6 +137,7 @@ export default function Dashboard() {
129137
<Stack.Screen
130138
name="bookmarks/[slug]/highlights"
131139
options={{
140+
...formSheetSurfaceOptions,
132141
headerTitle: "Highlights",
133142
headerTransparent: false,
134143
headerLargeTitle: false,
@@ -142,6 +151,7 @@ export default function Dashboard() {
142151
<Stack.Screen
143152
name="lists/new"
144153
options={{
154+
...formSheetSurfaceOptions,
145155
headerTitle: "New List",
146156
headerBackTitle: "Back",
147157
headerLargeTitle: false,
@@ -156,6 +166,7 @@ export default function Dashboard() {
156166
<Stack.Screen
157167
name="lists/[slug]/edit"
158168
options={{
169+
...formSheetSurfaceOptions,
159170
headerTitle: "Edit List",
160171
headerBackTitle: "Back",
161172
headerLargeTitle: false,
@@ -178,6 +189,7 @@ export default function Dashboard() {
178189
<Stack.Screen
179190
name="settings/index"
180191
options={{
192+
...formSheetSurfaceOptions,
181193
headerTitle: "Settings",
182194
headerTransparent: false,
183195
headerLargeTitle: false,

‎apps/mobile/components/ui/FAB/FAB.ios.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { isIOS26, isIPad } from "@/lib/ios";
77

88
const shouldUseGlass = isIOS26 && isGlassEffectAPIAvailable();
99
const SIZE = 62;
10+
const TAB_BAR_GAP = 8;
1011

1112
export function FAB({ children }: { children: ReactNode }) {
1213
const insets = useSafeAreaInsets();
@@ -16,7 +17,7 @@ export function FAB({ children }: { children: ReactNode }) {
1617
style={[
1718
styles.container,
1819
{
19-
bottom: insets.bottom + (isIPad ? 0 : isIOS26 ? 57 : 60),
20+
bottom: insets.bottom + (isIPad ? 0 : TAB_BAR_GAP),
2021
right: isIOS26 ? 21 : 16,
2122
},
2223
]}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { ColorValue } from "react-native";
2+
3+
export function getFormSheetSurfaceOptions(backgroundColor: ColorValue) {
4+
return {
5+
contentStyle: { backgroundColor },
6+
headerStyle: { backgroundColor },
7+
};
8+
}

0 commit comments

Comments
 (0)