-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCardButton.js
48 lines (46 loc) · 1.19 KB
/
CardButton.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
import React, { Component } from 'react';
import {
StyleSheet,
Text,
} from 'react-native';
import { Touchable } from './src';
export default class CardButton extends Component {
render() {
const newStyle = this.props.style || {};
const directionStyle = this.props.inColumn === true ? styles.CardButtonInColumn : styles.CardButtonInRow;
return (
<Touchable style={[directionStyle, newStyle]} onPress={() => { this.props.onPress(); }}>
<Text style={this.props.color !== undefined ? [styles.buttonText, { color: this.props.color }] : styles.buttonText}>{this.props.title.toUpperCase()}</Text>
</Touchable>
);
}
}
const styles = StyleSheet.create({
CardButtonInRow: {
height: 36,
marginLeft: 8,
marginTop: 8,
marginBottom: 8,
paddingLeft: 8,
paddingRight: 8,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 2,
},
CardButtonInColumn: {
height: 36,
marginLeft: 8,
marginTop: 8,
marginBottom: 8,
paddingLeft: 8,
paddingRight: 8,
justifyContent: 'center',
alignItems: 'flex-start',
borderRadius: 2,
},
buttonText: {
fontWeight: '600',
fontSize: 14,
color: 'orange',
},
});