forked from callstack/react-native-paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFABExample.js
53 lines (44 loc) · 1.08 KB
/
FABExample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* @flow */
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { Colors, FAB, withTheme } from 'react-native-paper';
import type { Theme } from 'react-native-paper/types';
type Props = {
theme: Theme,
};
class ButtonExample extends React.Component<Props> {
static title = 'Floating Action Button';
_handlePress = () => {};
render() {
const { theme: { colors: { background } } } = this.props;
return (
<View style={[styles.container, { backgroundColor: background }]}>
<View style={styles.row}>
<FAB
small
icon="add"
style={styles.fab}
onPress={this._handlePress}
/>
<FAB icon="add" style={styles.fab} onPress={this._handlePress} />
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.grey200,
padding: 4,
},
row: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
fab: {
margin: 8,
},
});
export default withTheme(ButtonExample);