feat: finish offsets on new navigation views

This commit is contained in:
Lei Nelissen
2023-04-23 23:31:35 +02:00
parent 81b9ba683a
commit c8283fc580
12 changed files with 227 additions and 152 deletions

View File

@@ -1,24 +0,0 @@
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 !== undefined ? 68 : 0
};
}
function SafeNavigatorView({ style, ...props }: ViewProps) {
const headerHeight = useHeaderHeight();
return (
<View {...props} style={[{ paddingTop: headerHeight }, style]} />
);
}
export default SafeNavigatorView;