-
Notifications
You must be signed in to change notification settings - Fork 1
/
OkButton.js
50 lines (46 loc) · 1.01 KB
/
OkButton.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
import React from 'react';
import { StyleSheet, View, TouchableNativeFeedback, Image } from 'react-native';
export default class OkButton extends React.Component {
static defaultProps = {
isEnabled : false,
handlePress : () => {}
}
render() {
return (
<TouchableNativeFeedback
style={{zIndex : 2}}
onPress={this.props.handlePress}>
<View style={this.props.isEnabled ? styles.okButton : styles.disabledOkButton}>
<Image
source={this.props.isEnabled ? require("./assets/buttons/ok.png") : require("./assets/buttons/ok_disabled.png")}
style={styles.okButtonImg}
/>
</View>
</TouchableNativeFeedback>
);
}
}
const styles = StyleSheet.create({
okButton : {
elevation: 5,
bottom: 150,
position: "absolute",
width : 80,
height: 80,
right : 20
},
okButtonImg : {
width : 80,
height: 80,
position:"absolute",
alignSelf : "center"
},
disabledOkButton : {
elevation: 0,
bottom: 150,
position: "absolute",
width : 80,
height: 80,
right : 20
},
});