Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Commit cbb0727

Browse files
committed
added code snippet
1 parent 19ed745 commit cbb0727

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
| secondary | false | boolean | secondary button flag |
5050
| backgroundColor | primary color | string (color) | background color of button |
5151
| color | white | string(color) | font color |
52+
| textStyle | none | object | text styling |
5253
| fontSize | 18 | number | font size |
5354
| underlayColor | transparent | string(color) | underlay color for button press |
5455
| raised | false | boolean | flag to add raised button styling |

src/components/buttons/Button.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const log = () => {
1414
console.log('please attach method to this component')
1515
}
1616

17-
const Button = ({buttonStyle, title, onPress, icon, secondary, secondary2, secondary3, primary1, primary2, primary3, backgroundColor, color, fontSize, underlayColor, raised}) => (
17+
const Button = ({buttonStyle, title, onPress, icon, secondary, secondary2, secondary3, primary1, primary2, primary3, backgroundColor, color, fontSize, underlayColor, raised, textStyle}) => (
1818
<TouchableHighlight
1919
underlayColor={underlayColor || 'transparent'}
2020
onPress={onPress || log}>
@@ -34,7 +34,7 @@ const Button = ({buttonStyle, title, onPress, icon, secondary, secondary2, secon
3434
{
3535
icon && <Icon color={icon.color || 'white'} size={icon.size || 26} style={styles.icon} name={icon.name} />
3636
}
37-
<Text style={[styles.text, color && {color}, fontSize && {fontSize}]}>
37+
<Text style={[styles.text, textStyle && textStyle, color && {color}, fontSize && {fontSize}]}>
3838
{title}
3939
</Text>
4040
</View>
@@ -45,7 +45,8 @@ Button.propTypes = {
4545
buttonStyle: PropTypes.any,
4646
title: PropTypes.string,
4747
onPress: PropTypes.any,
48-
icon: PropTypes.object
48+
icon: PropTypes.object,
49+
textStyle: PropTypes.any
4950
}
5051

5152
styles = StyleSheet.create({

0 commit comments

Comments
 (0)