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

@@ -1,11 +1,17 @@
import React from 'react';
import { ImageZoom } from '@likashefqet/react-native-image-zoom';
import { Meme } from '../../database';
import { View } from 'react-native';
import styles from '../../styles';
import LoadingView from '../loadingView';
import { StyleSheet, View } from 'react-native';
import { useSafeAreaFrame } from 'react-native-safe-area-context';
import { useImageDimensions } from '@react-native-community/hooks';
import LoadingView from '../loadingView';
import { Meme } from '../../database';
const memeViewItemStyles = StyleSheet.create({
view: {
justifyContent: 'center',
alignItems: 'center',
},
});
const MemeViewItem = ({ meme }: { meme: Meme }) => {
const { height, width } = useSafeAreaFrame();
@@ -15,7 +21,7 @@ const MemeViewItem = ({ meme }: { meme: Meme }) => {
if (loading || error || !dimensions) return <LoadingView />;
return (
<View style={[{ width, height }, styles.center]}>
<View style={[{ width, height }, memeViewItemStyles.view]}>
<ImageZoom
source={{ uri: meme.uri }}
style={