diff options
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Login.js | 5 | ||||
| -rw-r--r-- | app/components/LoginStyles.js | 8 | ||||
| -rw-r--r-- | app/components/styled/CellButton.js | 9 |
3 files changed, 7 insertions, 15 deletions
diff --git a/app/components/Login.js b/app/components/Login.js index 358657c43a..239156af5b 100644 --- a/app/components/Login.js +++ b/app/components/Login.js @@ -369,6 +369,7 @@ class AccountDropdown extends React.Component<AccountDropdownProps> { const uniqueItems = [...new Set(this.props.items)]; return ( <View> + <View style={ styles.account_dropdown__spacer }/> { uniqueItems.map(token => ( <AccountDropdownItem key={ token } value={ token } @@ -390,15 +391,13 @@ type AccountDropdownItemProps = { class AccountDropdownItem extends React.Component<AccountDropdownItemProps> { render() { - return (<View> - <View style={ styles.account_dropdown__spacer }/> + return ( <CellButton style={ styles.account_dropdown__item } hoverStyle={ styles.account_dropdown__item_hover }> <Label style={styles.account_dropdown__label} hoverStyle={ styles.account_dropdown__label_hover } onPress={ () => this.props.onSelect(this.props.value) }> { this.props.label } </Label> <Img style={styles.account_dropdown__remove} hoverStyle={ styles.account_dropdown__remove_hover } source='icon-close-sml' height='16' width='16' onPress={ () => this.props.onRemove(this.props.value) }/> </CellButton> - </View> ); } } diff --git a/app/components/LoginStyles.js b/app/components/LoginStyles.js index 7ecdeb0e67..b28a9ecae5 100644 --- a/app/components/LoginStyles.js +++ b/app/components/LoginStyles.js @@ -88,10 +88,6 @@ export default { backgroundColor: colors.white40, }, account_dropdown__remove: { - paddingTop: 10, - paddingLeft: 12, - paddingRight: 12, - paddingBottom: 12, justifyContent: 'center', color: colors.blue60, }, @@ -154,10 +150,6 @@ export default { lineHeight: 26, color: colors.blue80, border: 0, - paddingTop: 10, - paddingLeft: 12, - paddingRight: 12, - paddingBottom: 12, textAlign: 'left', }, }) 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>; } }) |
