Fix various spacing issues

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-25 22:00:33 +03:00
parent e479e3c0ad
commit caa98736e9
28 changed files with 362 additions and 488 deletions

View File

@@ -4,6 +4,7 @@ import {
NativeScrollEvent,
NativeSyntheticEvent,
View,
useWindowDimensions,
} from 'react-native';
import { useQuery } from '@realm/react';
import { useTheme } from 'react-native-paper';
@@ -20,11 +21,14 @@ import { ROUTE, SORT_DIRECTION, memesSortQuery } from '../types';
import { RootState, setNavVisible } from '../state';
import { Meme } from '../database';
import { HideableHeader, MemesHeader, MemesList } from '../components';
import { useDeviceOrientation } from '@react-native-community/hooks';
const Memes = () => {
const { colors } = useTheme();
const { navigate } =
useNavigation<NativeStackNavigationProp<ParamListBase>>();
const { height } = useWindowDimensions();
const orientation = useDeviceOrientation();
const sort = useSelector((state: RootState) => state.memes.sort);
const sortDirection = useSelector(
(state: RootState) => state.memes.sortDirection,
@@ -135,7 +139,10 @@ const Memes = () => {
search={search}
setSearch={setSearch}
onLayout={event => {
setFlashListPadding(event.nativeEvent.layout.height);
setFlashListPadding(
event.nativeEvent.layout.height +
height * (orientation === 'portrait' ? 0.02 : 0.04),
);
}}
/>
</HideableHeader>