Last active
October 17, 2024 20:58
-
-
Save Klerith/a84d9e8ed7ab4a3c5510c01cc78970b6 to your computer and use it in GitHub Desktop.
Botón flotante
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Ionicons } from '@expo/vector-icons'; | |
import { StyleProp, ViewStyle, TouchableOpacity } from 'react-native'; | |
interface Props { | |
iconName: keyof typeof Ionicons.glyphMap; | |
onPress: () => void; | |
style?: StyleProp<ViewStyle>; | |
} | |
export const FAB = ({ style, iconName, onPress }: Props) => { | |
return ( | |
<TouchableOpacity | |
style={[ | |
{ | |
position: 'absolute', | |
bottom: 30, | |
right: 20, | |
width: 60, | |
height: 60, | |
shadowColor: 'black', | |
backgroundColor: 'black', | |
shadowOffset: { | |
width: 0, | |
height: 10, | |
}, | |
shadowOpacity: 0.4, | |
shadowRadius: 10, | |
elevation: 3, | |
borderRadius: 13, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
style, | |
]} | |
onPress={onPress} | |
> | |
<Ionicons name={iconName} size={30} color="white" /> | |
</TouchableOpacity> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment