-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCancelButton.js
50 lines (46 loc) · 1.22 KB
/
CancelButton.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 CancelButton extends React.Component {
static defaultProps = {
isEnabled : false,
handlePress : () => {}
}
render() {
return (
<TouchableNativeFeedback
style={{zIndex : 2}}
onPress={this.props.handlePress}>
<View style={this.props.isEnabled ? styles.cancelButton : styles.disabledCancelButton}>
<Image
source={this.props.isEnabled ? require("./assets/buttons/cancel.png") : require("./assets/buttons/cancel_disabled.png")}
style={styles.cancelButtonImg}
/>
</View>
</TouchableNativeFeedback>
);
}
}
const styles = StyleSheet.create({
cancelButton : {
elevation: 5,
bottom: 150,
position: "absolute",
width : 80,
height: 80,
left : 20
},
cancelButtonImg : {
width : 80,
height: 80,
position:"absolute",
alignSelf : "center"
},
disabledCancelButton : {
elevation: 0,
bottom: 150,
position: "absolute",
width : 80,
height: 80,
left : 20
}
});