Add actionButton
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
53
src/components/actionButton.tsx
Normal file
53
src/components/actionButton.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import * as React from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import { FAB, Portal } from 'react-native-paper';
|
||||
import { noOp } from '../constants';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
fab: {
|
||||
marginBottom: 100,
|
||||
},
|
||||
});
|
||||
|
||||
const ActionButton = () => {
|
||||
const [state, setState] = React.useState(false);
|
||||
|
||||
return (
|
||||
<Portal>
|
||||
<FAB.Group
|
||||
open={state}
|
||||
visible
|
||||
icon={state ? 'image' : 'plus'}
|
||||
actions={[
|
||||
{
|
||||
icon: 'tag',
|
||||
label: 'Tag',
|
||||
onPress: () => noOp,
|
||||
},
|
||||
{
|
||||
icon: 'note-text',
|
||||
label: 'Text',
|
||||
onPress: () => noOp,
|
||||
},
|
||||
{
|
||||
icon: 'microphone',
|
||||
label: 'Audio',
|
||||
onPress: () => noOp,
|
||||
},
|
||||
{
|
||||
icon: 'image-album',
|
||||
label: 'Album',
|
||||
onPress: () => noOp,
|
||||
},
|
||||
]}
|
||||
onStateChange={({ open }) => setState(open)}
|
||||
onPress={() => {
|
||||
if (state) noOp;
|
||||
}}
|
||||
style={styles.fab}
|
||||
/>
|
||||
</Portal>
|
||||
);
|
||||
};
|
||||
|
||||
export default ActionButton;
|
Reference in New Issue
Block a user