mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-07-14 18:15:56 -04:00
- Wrap tab bar trigger labels and stack screen titles with `useLingui()` / `t` so they translate correctly across all 6 supported locales - Swap `IconDeviceTv` → `IconDeviceTvOld` in the recently-viewed badge to match the icon used elsewhere in the app - Show the type icon inside the pill badge and display a department label (Actor, Director, Writer, etc.) for person results instead of the generic "Person" / "TV" label - Suppress the subtitle row for person results (department is shown in the badge instead) - Merge the separate iOS/Android `headerTitleStyle` variables in `TabStack` into a single shared style - Mark `packages/i18n/src/po/*` as readonly/excluded in VS Code settings alongside `routeTree.gen.ts` - Extract and compile updated PO/TS catalogs for all locales (de, en, es, fr, it, pt)
80 lines
2.3 KiB
TypeScript
80 lines
2.3 KiB
TypeScript
import { Stack } from "expo-router";
|
|
import type { ReactNode } from "react";
|
|
import { useCSSVariable, useResolveClassNames } from "uniwind";
|
|
|
|
import { HeaderAvatar } from "@/components/header-avatar";
|
|
|
|
export function TabStack({ title, children }: { title?: string; children?: ReactNode }) {
|
|
const contentStyle = useResolveClassNames("bg-background");
|
|
const tintColor = useCSSVariable("--color-primary") as string;
|
|
const backgroundColor = useCSSVariable("--color-background") as string;
|
|
const headerTitleStyle = useResolveClassNames("font-display text-foreground text-xl");
|
|
const headerLargeTitleStyle = useResolveClassNames("font-display text-foreground");
|
|
|
|
if (process.env.EXPO_OS === "ios") {
|
|
return (
|
|
<Stack
|
|
screenOptions={{
|
|
contentStyle,
|
|
unstable_headerRightItems: () => [
|
|
{
|
|
type: "custom" as const,
|
|
element: <HeaderAvatar />,
|
|
hidesSharedBackground: true,
|
|
},
|
|
],
|
|
}}
|
|
>
|
|
{title ? (
|
|
<Stack.Screen name="index">
|
|
<Stack.Header
|
|
transparent
|
|
blurEffect="systemChromeMaterialDark"
|
|
style={{ color: tintColor, shadowColor: "transparent" }}
|
|
largeStyle={{
|
|
backgroundColor: "transparent",
|
|
shadowColor: "transparent",
|
|
}}
|
|
/>
|
|
<Stack.Screen.Title
|
|
large
|
|
style={headerTitleStyle as Record<string, unknown>}
|
|
largeStyle={headerLargeTitleStyle as Record<string, unknown>}
|
|
>
|
|
{title}
|
|
</Stack.Screen.Title>
|
|
</Stack.Screen>
|
|
) : null}
|
|
{children}
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Stack
|
|
screenOptions={{
|
|
contentStyle,
|
|
headerTitleAlign: "left",
|
|
headerRight: () => <HeaderAvatar />,
|
|
}}
|
|
>
|
|
{title ? (
|
|
<Stack.Screen name="index">
|
|
<Stack.Header
|
|
transparent={false}
|
|
style={{
|
|
backgroundColor,
|
|
color: tintColor,
|
|
shadowColor: "transparent",
|
|
}}
|
|
/>
|
|
<Stack.Screen.Title style={headerTitleStyle as Record<string, unknown>}>
|
|
{title}
|
|
</Stack.Screen.Title>
|
|
</Stack.Screen>
|
|
) : null}
|
|
{children}
|
|
</Stack>
|
|
);
|
|
}
|