Add memes & meme-editing views

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-22 17:13:16 +03:00
parent fa0a89f324
commit e44ee7de34
16 changed files with 298 additions and 101 deletions

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { HelperText, TextInput } from 'react-native-paper';
import { Image } from 'react-native';
import { useDimensions } from '../../contexts';
@@ -46,13 +46,11 @@ const MemeEditor = ({
const [imageWidth, setImageWidth] = useState<number>();
const [imageHeight, setImageHeight] = useState<number>();
useEffect(() => {
Image.getSize(imageUri, (width, height) => {
const paddedWidth = dimensions.width * 0.92;
setImageWidth(paddedWidth);
setImageHeight((paddedWidth / width) * height);
});
}, [dimensions.width, imageUri]);
Image.getSize(imageUri, (width, height) => {
const paddedWidth = dimensions.width * 0.92;
setImageWidth(paddedWidth);
setImageHeight((paddedWidth / width) * height);
});
if (!imageWidth || !imageHeight) return <LoadingView />;