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

@@ -3,7 +3,7 @@ import { Keyboard, StyleSheet } from 'react-native';
import { FAB } from 'react-native-paper';
import { ParamListBase, useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { pick } from 'react-native-document-picker';
import { pickSingle } from 'react-native-document-picker';
import { ORIENTATION, useDimensions } from '../contexts';
import { ROUTE } from '../types';
import { allowedMimeTypes, noOp } from '../utilities';
@@ -65,9 +65,9 @@ const FloatingActionButton = ({ visible = true }: { visible?: boolean }) => {
onStateChange={({ open }) => setState(open)}
onPress={async () => {
if (!state) return;
const res = await pick({ type: allowedMimeTypes }).catch(noOp);
if (!res) return;
navigate(ROUTE.ADD_MEME, { uri: res });
const file = await pickSingle({ type: allowedMimeTypes }).catch(noOp);
if (!file) return;
navigate(ROUTE.ADD_MEME, { file });
}}
style={
orientation === ORIENTATION.PORTRAIT