xref: /MusicFree/src/components/base/statusBar.tsx (revision 5589cdf32b2bb0f641e5ac7bf1f6152cd6b9b70e)
1import React from 'react';
2import {StatusBar, StatusBarProps, View} from 'react-native';
3import useColors from '@/hooks/useColors';
4
5interface IStatusBarProps extends StatusBarProps {}
6
7export default function (props: IStatusBarProps) {
8    const colors = useColors();
9    const {backgroundColor, barStyle} = props;
10
11    return (
12        <>
13            <StatusBar
14                backgroundColor={'rgba(0,0,0,0)'}
15                barStyle={barStyle ?? 'light-content'}
16            />
17            <View
18                style={{
19                    zIndex: 10000,
20                    position: 'absolute',
21                    top: 0,
22                    backgroundColor:
23                        backgroundColor ?? colors.appBar ?? colors.primary,
24                    width: '100%',
25                    height: StatusBar.currentHeight,
26                }}
27            />
28        </>
29    );
30}
31