diff --git a/apps/mobile/src/app/_layout.tsx b/apps/mobile/src/app/_layout.tsx index 4bcc0d65..5c651621 100644 --- a/apps/mobile/src/app/_layout.tsx +++ b/apps/mobile/src/app/_layout.tsx @@ -16,7 +16,7 @@ import { forgetQueries, persistQueries, restoreQueries } from "@/lib/persist"; import { qk, queryClient } from "@/lib/query"; import { startRealtime } from "@/lib/realtime"; import { useSession } from "@/lib/session"; -import { fonts, useColors, useNavigationTheme } from "@/lib/theme"; +import { fonts, useColors, useNavigationTheme, usePageStyle } from "@/lib/theme"; void SplashScreen.preventAutoHideAsync(); @@ -36,6 +36,7 @@ export default function RootLayout() { const deviceId = useSession((s) => s.connection?.deviceId); const theme = useNavigationTheme(); const c = useColors(); + const page = usePageStyle(); const [fontsLoaded, fontError] = useFonts(FONT_FILES); const fontsReady = fontsLoaded || !!fontError; @@ -83,9 +84,9 @@ export default function RootLayout() { - + - + @@ -109,7 +110,7 @@ export default function RootLayout() { - + diff --git a/apps/mobile/src/components/tab-stack.tsx b/apps/mobile/src/components/tab-stack.tsx index 1262bb90..fbe8c89a 100644 --- a/apps/mobile/src/components/tab-stack.tsx +++ b/apps/mobile/src/components/tab-stack.tsx @@ -1,11 +1,12 @@ import { Stack } from "expo-router"; -import { useColors } from "@/lib/theme"; +import { useColors, usePageStyle } from "@/lib/theme"; const ios = process.env.EXPO_OS === "ios"; /** The navigation stack inside each tab: large titles over glass on iOS, a flat bar on Android. */ export function TabStack() { const c = useColors(); + const page = usePageStyle(); return ( ); diff --git a/apps/mobile/src/lib/theme.ts b/apps/mobile/src/lib/theme.ts index cd011f39..ed89b991 100644 --- a/apps/mobile/src/lib/theme.ts +++ b/apps/mobile/src/lib/theme.ts @@ -1,4 +1,5 @@ -import { useColorScheme, type TextStyle } from "react-native"; +import { useColorScheme, type TextStyle, type ViewStyle } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; import { DarkTheme, DefaultTheme, type Theme } from "expo-router"; import { useAppearance } from "./appearance"; @@ -177,3 +178,10 @@ export function useNavigationTheme(): Theme { }, }; } + +/** A screen's background, kept clear of side safe areas: the iPhone Duo cover screen puts the status bar, tab bar and header buttons in a column on the right. */ +export function usePageStyle(): ViewStyle { + const c = useColors(); + const { left, right } = useSafeAreaInsets(); + return { backgroundColor: c.background, paddingLeft: left, paddingRight: right }; +} diff --git a/docs/screenshots/duo-before-home.png b/docs/screenshots/duo-before-home.png new file mode 100644 index 00000000..7933a758 Binary files /dev/null and b/docs/screenshots/duo-before-home.png differ diff --git a/docs/screenshots/duo-chat.png b/docs/screenshots/duo-chat.png new file mode 100644 index 00000000..d755b1a9 Binary files /dev/null and b/docs/screenshots/duo-chat.png differ diff --git a/docs/screenshots/duo-home-dark.png b/docs/screenshots/duo-home-dark.png new file mode 100644 index 00000000..51efa6c4 Binary files /dev/null and b/docs/screenshots/duo-home-dark.png differ diff --git a/docs/screenshots/duo-home.png b/docs/screenshots/duo-home.png new file mode 100644 index 00000000..f4b0967d Binary files /dev/null and b/docs/screenshots/duo-home.png differ diff --git a/docs/screenshots/duo-settings.png b/docs/screenshots/duo-settings.png new file mode 100644 index 00000000..3d0b7df2 Binary files /dev/null and b/docs/screenshots/duo-settings.png differ