From b3b2cfe9093cc9b95d35771d3029e05bc524d380 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 31 Aug 2022 20:09:58 -0500 Subject: Add composer FAB to home page --- src/view/com/util/FloatingActionButton.tsx | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/view/com/util/FloatingActionButton.tsx (limited to 'src/view/com/util/FloatingActionButton.tsx') diff --git a/src/view/com/util/FloatingActionButton.tsx b/src/view/com/util/FloatingActionButton.tsx new file mode 100644 index 000000000..acfc48667 --- /dev/null +++ b/src/view/com/util/FloatingActionButton.tsx @@ -0,0 +1,50 @@ +import React from 'react' +import {GestureResponderEvent, StyleSheet, TouchableOpacity} from 'react-native' +import LinearGradient from 'react-native-linear-gradient' +import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' +import {IconProp} from '@fortawesome/fontawesome-svg-core' +import {colors, gradients} from '../../lib/styles' +import * as zIndex from '../../lib/z-index' + +type OnPress = ((event: GestureResponderEvent) => void) | undefined +export function FAB({icon, onPress}: {icon: IconProp; onPress: OnPress}) { + return ( + + + + + + ) +} + +const styles = StyleSheet.create({ + outer: { + position: 'absolute', + zIndex: zIndex.FAB, + right: 20, + bottom: 20, + width: 50, + height: 50, + borderRadius: 25, + shadowColor: '#000', + shadowOpacity: 0.3, + shadowOffset: {width: 0, height: 1}, + }, + inner: { + width: 50, + height: 50, + borderRadius: 25, + justifyContent: 'center', + alignItems: 'center', + }, + icon: {}, +}) -- cgit 1.4.1