diff options
Diffstat (limited to 'app/components/styled/CellButton.js')
| -rw-r--r-- | app/components/styled/CellButton.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/components/styled/CellButton.js b/app/components/styled/CellButton.js index fc05c3b162..ef96dbce98 100644 --- a/app/components/styled/CellButton.js +++ b/app/components/styled/CellButton.js @@ -72,8 +72,9 @@ export class Label extends Text {} type CellButtonProps = { children?: React.Node, - disabled: boolean, + disabled?: boolean, hoverStyle?: Types.ViewStyle, + style?: Types.ViewStyle }; type State = { hovered: boolean }; @@ -90,9 +91,9 @@ export default class CellButton extends Component<CellButtonProps, State> { onHoverEnd = () => !this.props.disabled ? this.setState({ hovered: false }) : null; render() { - const { children, hoverStyle, ...otherProps } = this.props; + const { children, style, hoverStyle, ...otherProps } = this.props; return ( - <Button style={[ styles.cell, this.props.style, this.backgroundStyle(hoverStyle) ]} + <Button style={[ styles.cell, style, this.backgroundStyle(hoverStyle) ]} onHoverStart={this.onHoverStart} onHoverEnd={this.onHoverEnd} {...otherProps}> @@ -114,7 +115,7 @@ export default class CellButton extends Component<CellButtonProps, State> { } return React.cloneElement(node, updatedProps); - } else { + } else if (node != null){ return <Label style={[styles.label, this.textStyle()]}>{children}</Label>; } }) |
