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