mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import * as NavigationBar from 'expo-navigation-bar'
2import * as SystemUI from 'expo-system-ui'
3
4import {isAndroid} from '#/platform/detection'
5import {Theme} from '../types'
6
7export function setNavigationBar(themeType: 'theme' | 'lightbox', t: Theme) {
8 if (isAndroid) {
9 if (themeType === 'theme') {
10 NavigationBar.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
11 NavigationBar.setBorderColorAsync(t.atoms.bg.backgroundColor)
12 NavigationBar.setButtonStyleAsync(t.name !== 'light' ? 'light' : 'dark')
13 SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
14 } else {
15 NavigationBar.setBackgroundColorAsync('black')
16 NavigationBar.setBorderColorAsync('black')
17 NavigationBar.setButtonStyleAsync('light')
18 SystemUI.setBackgroundColorAsync('black')
19 }
20 }
21}