POWR/lib/android-navigation-bar.ts
2025-03-12 19:23:28 -04:00

12 lines
473 B
TypeScript

import * as NavigationBar from 'expo-navigation-bar';
import { Platform } from 'react-native';
import { NAV_THEME } from '@/lib/theme/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
);
}