xref: /MusicFree/src/components/base/statusBar.tsx (revision 9c72192f09e3e71b70c1fb446447ba438c4fffbd)
1*9c72192fS猫头猫import React from 'react';
219dc08ecS猫头猫import {StatusBar, StatusBarProps, View} from 'react-native';
319dc08ecS猫头猫import useColors from '@/hooks/useColors';
419dc08ecS猫头猫
519dc08ecS猫头猫interface IStatusBarProps extends StatusBarProps {}
619dc08ecS猫头猫
719dc08ecS猫头猫export default function (props: IStatusBarProps) {
819dc08ecS猫头猫    const colors = useColors();
91119c2eaS猫头猫    const {backgroundColor, barStyle} = props;
101119c2eaS猫头猫
1119dc08ecS猫头猫    return (
12*9c72192fS猫头猫        <>
13*9c72192fS猫头猫            <StatusBar
14*9c72192fS猫头猫                backgroundColor={'rgba(0,0,0,0)'}
15*9c72192fS猫头猫                barStyle={barStyle ?? 'light-content'}
16*9c72192fS猫头猫            />
1719dc08ecS猫头猫            <View
1819dc08ecS猫头猫                style={{
1920e2869eS猫头猫                    zIndex: 10000,
2019dc08ecS猫头猫                    position: 'absolute',
2119dc08ecS猫头猫                    top: 0,
226cfecf1cS猫头猫                    backgroundColor:
236cfecf1cS猫头猫                        backgroundColor ?? colors.appBar ?? colors.primary,
244ddc4470S猫头猫                    width: '100%',
2519dc08ecS猫头猫                    height: StatusBar.currentHeight,
264060c00aS猫头猫                }}
274060c00aS猫头猫            />
28*9c72192fS猫头猫        </>
2919dc08ecS猫头猫    );
3019dc08ecS猫头猫}
31