Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,25 @@ Other [Ripple][ripple] properties will also work

## TextButton properties

name | description | type | default
:------------------ |:------------------------------------- | --------:|:------------------
title | Button title | String | -
titleColor | Button title color | String | rgb(0, 0, 0)
disabledTitleColor | Button title color for disabled state | String | rgba(0, 0, 0, .26)
titleStyle | Button title style | Object | -
name | description | type | default
:------------------ |:-------------------------------------- | ---------:|:------------------
title | Button title | String | -
titleColor | Button title color | String | rgb(0, 0, 0)
disabledTitleColor | Button title color for disabled state | String | rgba(0, 0, 0, .26)
titleStyle | Button title style | Object | -
icon | Icon component to place next to text | Component | -
iconPlacement | Which side of text Icon will appear on | String | "left"

## RaisedTextButton properties

name | description | type | default
:------------------ |:------------------------------------- | --------:|:------------------
title | Button title | String | -
titleColor | Button title color | String | rgb(66, 66, 66)
disabledTitleColor | Button title color for disabled state | String | rgba(0, 0, 0, .26)
titleStyle | Button title style | Object | -
name | description | type | default
:------------------ |:-------------------------------------- | ---------:|:------------------
title | Button title | String | -
titleColor | Button title color | String | rgb(66, 66, 66)
disabledTitleColor | Button title color for disabled state | String | rgba(0, 0, 0, .26)
titleStyle | Button title style | Object | -
icon | Icon component to place next to text | Component | -
iconPlacement | Which side of text Icon will appear on | String | "left"

## Example

Expand Down
3 changes: 3 additions & 0 deletions src/components/button/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const styles = StyleSheet.create({
container: {
borderRadius: 2,
justifyContent: 'space-around',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
},

shadeContainer: {
Expand Down
3 changes: 3 additions & 0 deletions src/components/raised-button/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const styles = StyleSheet.create({
height: 36,
minWidth: 88,
paddingHorizontal: 16,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',

...Platform.select({
android: {
Expand Down
4 changes: 4 additions & 0 deletions src/components/raised-text-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export default class RaisedTextButton extends PureComponent {
titleColor,
titleStyle,
disabledTitleColor,
icon,
iconPlacement,
...props
} = this.props;

Expand All @@ -57,12 +59,14 @@ export default class RaisedTextButton extends PureComponent {
{...props}
disableAnimation={disableAnimation}
>
{icon && iconPlacement !== 'right' && icon}
<Animated.Text
style={[styles.title, titleStyle, titleStyleOverrides]}
numberOfLines={1}
>
{title}
</Animated.Text>
{icon && iconPlacement === 'right' && icon}
</RaisedButton>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/text-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export default class TextButton extends PureComponent {
titleColor,
titleStyle,
disabledTitleColor,
icon,
iconPlacement,
style,
...props
} = this.props;
Expand All @@ -64,12 +66,14 @@ export default class TextButton extends PureComponent {
{...props}
disableAnimation={disableAnimation}
>
{icon && iconPlacement !== 'right' && icon}
<Animated.Text
style={[styles.title, titleStyle, titleStyleOverrides]}
numberOfLines={1}
>
{title}
</Animated.Text>
{icon && iconPlacement === 'right' && icon}
</Button>
);
}
Expand Down