Fix various spacing issues
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user