Refactor styles

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-26 10:14:01 +03:00
parent caa98736e9
commit abe1c0847d
22 changed files with 261 additions and 328 deletions

View File

@@ -3,6 +3,7 @@ import {
BackHandler,
NativeScrollEvent,
NativeSyntheticEvent,
StyleSheet,
View,
useWindowDimensions,
} from 'react-native';
@@ -16,13 +17,20 @@ import {
useNavigation,
} from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import styles from '../styles';
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 memesStyles = StyleSheet.create({
listView: {
paddingHorizontal: '4%',
width: '100%',
height: '100%',
},
});
const Memes = () => {
const { colors } = useTheme();
const { navigate } =
@@ -128,12 +136,7 @@ const Memes = () => {
);
return (
<View
style={[
styles.paddingHorizontal,
styles.fullSize,
{ backgroundColor: colors.background },
]}>
<>
<HideableHeader visible={navVisisble}>
<MemesHeader
search={search}
@@ -146,19 +149,22 @@ const Memes = () => {
}}
/>
</HideableHeader>
<MemesList
memes={memes}
flashListRef={flashListRef}
flashListPadding={flashListPadding}
handleScroll={handleScroll}
focusMeme={(index: number) => {
navigate(ROUTE.MEME_VIEW, {
ids: memes.map(meme => meme.id.toHexString()),
index,
});
}}
/>
</View>
<View
style={[memesStyles.listView, { backgroundColor: colors.background }]}>
<MemesList
memes={memes}
flashListRef={flashListRef}
flashListPadding={flashListPadding}
handleScroll={handleScroll}
focusMeme={(index: number) => {
navigate(ROUTE.MEME_VIEW, {
ids: memes.map(meme => meme.id.toHexString()),
index,
});
}}
/>
</View>
</>
);
};