mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
12 lines
468 B
TypeScript
12 lines
468 B
TypeScript
import * as NavigationBar from "expo-navigation-bar";
|
|
import { Platform } from "react-native";
|
|
import { NAV_THEME } from "@/lib/constants";
|
|
|
|
export async function setAndroidNavigationBar(theme: "light" | "dark") {
|
|
if (Platform.OS !== "android") return;
|
|
await NavigationBar.setButtonStyleAsync(theme === "dark" ? "light" : "dark");
|
|
await NavigationBar.setBackgroundColorAsync(
|
|
theme === "dark" ? NAV_THEME.dark.background : NAV_THEME.light.background,
|
|
);
|
|
}
|