diff options
| author | anderklander <anderklander@gmail.com> | 2018-03-25 20:39:53 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-03-26 14:22:11 +0200 |
| commit | 7dd3ecbed8d542efe97c36d9912f82920e5bdb7c (patch) | |
| tree | 3f4e22f57bbab6a3b2caa5d78459cbed58e40bff /app/components/styled | |
| parent | 716019047ce298d9dc82d508b9640fe2118d4e26 (diff) | |
| download | mullvadvpn-7dd3ecbed8d542efe97c36d9912f82920e5bdb7c.tar.xz mullvadvpn-7dd3ecbed8d542efe97c36d9912f82920e5bdb7c.zip | |
Fix usage of cellbutton
Diffstat (limited to 'app/components/styled')
| -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>; } }) |
