mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-03-03 03:47:02 +00:00
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { Stack, useRouter } from "expo-router";
|
|
import { useColorScheme } from "nativewind";
|
|
import { rawTheme, ThemeName } from "@/lib/colors";
|
|
import { Platform } from "react-native";
|
|
|
|
export default function Layout() {
|
|
const router = useRouter();
|
|
const { colorScheme } = useColorScheme();
|
|
|
|
return (
|
|
<Stack
|
|
screenOptions={{
|
|
headerTitle: "Collections",
|
|
headerLargeTitle: true,
|
|
headerTransparent: Platform.OS === "ios" ? true : false,
|
|
headerShadowVisible: false,
|
|
headerBlurEffect:
|
|
colorScheme === "dark" ? "systemMaterialDark" : "systemMaterial",
|
|
headerTintColor: colorScheme === "dark" ? "white" : "black",
|
|
headerSearchBarOptions: {
|
|
placeholder: "Search Collections",
|
|
autoCapitalize: "none",
|
|
onChangeText: (e) => {
|
|
router.setParams({
|
|
search: encodeURIComponent(e.nativeEvent.text),
|
|
});
|
|
},
|
|
headerIconColor: colorScheme === "dark" ? "white" : "black",
|
|
},
|
|
headerLargeStyle: {
|
|
backgroundColor: rawTheme[colorScheme as ThemeName]["base-100"],
|
|
},
|
|
headerStyle: {
|
|
backgroundColor:
|
|
Platform.OS === "ios"
|
|
? "transparent"
|
|
: colorScheme === "dark"
|
|
? rawTheme["dark"]["base-100"]
|
|
: "white",
|
|
},
|
|
}}
|
|
/>
|
|
);
|
|
}
|