Skip to content

Commit

Permalink
Merge pull request #30 from santomegonzalo/rollback-breaking-changes
Browse files Browse the repository at this point in the history
support old actionsTextColor and actionsTextBackground properties for now
  • Loading branch information
santomegonzalo authored Feb 9, 2018
2 parents 9f6a177 + 0106033 commit 8b34ca0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
35 changes: 23 additions & 12 deletions component/FloatingAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ class FloatingAction extends Component {
position,
overrideWithAction,
distanceToEdge,
actionsPaddingTopBottom
actionsPaddingTopBottom,
actionsTextBackground,
actionsTextColor
} = this.props;
const { active } = this.state;

Expand All @@ -231,17 +233,24 @@ class FloatingAction extends Component {
return (
<Animated.View style={actionsStyles} pointerEvents="box-none">
{
sortBy(actions, ['position']).map(action => (
<FloatingActionItem
paddingTopBottom={actionsPaddingTopBottom}
distanceToEdge={distanceToEdge}
key={action.name}
{...action}
position={position}
active={active}
onPress={this.handlePressItem}
/>
))
sortBy(actions, ['position']).map((action) => {
const textColor = action.textColor || action.actionsTextColor;
const textBackground = action.textBackground || action.actionsTextBackground;

return (
<FloatingActionItem
paddingTopBottom={actionsPaddingTopBottom}
distanceToEdge={distanceToEdge}
key={action.name}
textColor={textColor}
textBackground={textBackground}
{...action}
position={position}
active={active}
onPress={this.handlePressItem}
/>
)
})
}
</Animated.View>
);
Expand Down Expand Up @@ -294,6 +303,8 @@ FloatingAction.propTypes = {
name: PropTypes.string.isRequired,
position: PropTypes.number.isRequired
})),
actionsTextBackground: PropTypes.string, // @deprecated in favor of textBackground
actionsTextColor: PropTypes.string, // @deprecated in favor of textColor
textBackground: PropTypes.string,
textColor: PropTypes.string,
position: PropTypes.oneOf(['right', 'left', 'center']),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-floating-action",
"version": "1.8.2",
"version": "1.9.0",
"description": "floating action component for react-native",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 8b34ca0

Please sign in to comment.