Add tag datatable
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,23 +1,18 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { StyleSheet, Keyboard } from 'react-native';
|
||||
import { Keyboard } from 'react-native';
|
||||
import { FAB } from 'react-native-paper';
|
||||
import { ParamListBase, useNavigation } from '@react-navigation/native';
|
||||
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
||||
import { useDimensions } from '../contexts';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
fab: {
|
||||
position: 'absolute',
|
||||
},
|
||||
});
|
||||
|
||||
const FloatingActionButton = ({ visible = true }: { visible?: boolean }) => {
|
||||
const { navigate } =
|
||||
useNavigation<NativeStackNavigationProp<ParamListBase>>();
|
||||
const dimensions = useDimensions();
|
||||
const { responsive } = useDimensions();
|
||||
|
||||
const [state, setState] = useState(false);
|
||||
const [keyboardOpen, setKeyboardOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const keyboardDidShowListener = Keyboard.addListener(
|
||||
'keyboardDidShow',
|
||||
@@ -29,8 +24,8 @@ const FloatingActionButton = ({ visible = true }: { visible?: boolean }) => {
|
||||
);
|
||||
|
||||
return () => {
|
||||
keyboardDidHideListener.remove();
|
||||
keyboardDidShowListener.remove();
|
||||
keyboardDidHideListener.remove();
|
||||
};
|
||||
}, []);
|
||||
|
||||
@@ -60,13 +55,10 @@ const FloatingActionButton = ({ visible = true }: { visible?: boolean }) => {
|
||||
onPress={() => {
|
||||
if (state) navigate('Add Meme');
|
||||
}}
|
||||
style={[
|
||||
styles.fab,
|
||||
{
|
||||
paddingRight: dimensions.responsive.horizontalScale(10),
|
||||
paddingBottom: dimensions.responsive.verticalScale(75),
|
||||
},
|
||||
]}
|
||||
style={{
|
||||
paddingBottom: responsive.verticalScale(75),
|
||||
paddingRight: responsive.horizontalScale(10),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user