about summary refs log tree commit diff
path: root/src/state/shell/light-status-bar.tsx
blob: 80df9ad90cb9e6056e81715657af0511dfc93ef3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {useEffect} from 'react'
import {SystemBars} from 'react-native-edge-to-edge'

export function useSetLightStatusBar(enabled: boolean) {
  useEffect(() => {
    if (enabled) {
      const entry = SystemBars.pushStackEntry({
        style: {
          statusBar: 'light',
        },
      })
      return () => {
        SystemBars.popStackEntry(entry)
      }
    }
  }, [enabled])
}