feat: add blurview to headers as well

This commit is contained in:
Lei Nelissen
2023-04-22 23:31:37 +02:00
parent e2c1c0300f
commit 1a5e4aee12
14 changed files with 105 additions and 45 deletions

View File

@@ -0,0 +1,24 @@
import { useHeaderHeight } from '@react-navigation/elements';
import React from 'react';
import { View, ViewProps } from 'react-native';
import useCurrentTrack from './useCurrentTrack';
export function useNavigatorPadding() {
const headerHeight = useHeaderHeight();
const { index } = useCurrentTrack();
return {
paddingTop: headerHeight,
paddingBottom: index ? 68 : 0
};
}
function SafeNavigatorView({ style, ...props }: ViewProps) {
const headerHeight = useHeaderHeight();
return (
<View {...props} style={[{ paddingTop: headerHeight }, style]} />
);
}
export default SafeNavigatorView;