diff options
| author | anderklander <anderklander@gmail.com> | 2018-02-15 14:05:28 +0100 |
|---|---|---|
| committer | anderklander <anderklander@gmail.com> | 2018-02-15 16:02:03 +0100 |
| commit | 89eeb129f065d92a82393db2deca58c0c0f2ff38 (patch) | |
| tree | 9d61e6b951139dfb061c1898b7eb0aab4c5e3e73 /app/components/styled/CellButton.js | |
| parent | 7ed21c2ae70a875029715d4d4c10a1c59508d6fa (diff) | |
| download | mullvadvpn-89eeb129f065d92a82393db2deca58c0c0f2ff38.tar.xz mullvadvpn-89eeb129f065d92a82393db2deca58c0c0f2ff38.zip | |
Refactoring stuff, removed Icon
Diffstat (limited to 'app/components/styled/CellButton.js')
| -rw-r--r-- | app/components/styled/CellButton.js | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/app/components/styled/CellButton.js b/app/components/styled/CellButton.js index ca5b0a3739..7309180241 100644 --- a/app/components/styled/CellButton.js +++ b/app/components/styled/CellButton.js @@ -1,11 +1,10 @@ // @flow import React from 'react'; -import { Component } from 'reactxp'; +import { Text, Component } from 'reactxp'; import { Button } from './Button'; -import { Label } from './Label'; import { colors } from '../../config'; -import { createViewStyles } from '../../lib/styles'; +import { createViewStyles, createTextStyles } from '../../lib/styles'; const styles = { ...createViewStyles({ @@ -39,13 +38,32 @@ const styles = { color: colors.white, }, icon: { - position: 'relative', + marginLeft: 8, + }, + }), + ...createTextStyles({ + label:{ alignSelf: 'center', + fontFamily: 'DINPro', + fontSize: 20, + fontWeight: '900', + lineHeight: 26, + flex: 1, marginLeft: 8, }, + subtext:{ + fontFamily: 'Open Sans', + fontSize: 13, + fontWeight: '800', + flex: 0, + textAlign: 'right', + }, }), }; +export class SubText extends Text {} +export class Label extends Text {} + export default class CellButton extends Component { props: { children: Array<React.Element<*>> | React.Element<*>, @@ -75,20 +93,20 @@ export default class CellButton extends Component { let updatedProps = {}; if(node.type.name === 'Label') { - updatedProps = { style: [this.textStyle(), node.props.style]}; + updatedProps = { style: [styles.label, this.textStyle(), node.props.style]}; } - if(node.type.name === 'Icon') { - updatedProps = { style: [this.iconStyle(), styles.icon, node.props.style]}; + if(node.type.name === 'Img') { + updatedProps = { tintColor:'currentColor', style: [styles.icon, this.iconStyle(), node.props.style]}; } if(node.type.name === 'SubText') { - updatedProps = { style: [this.subtextStyle(), node.props.style]}; + updatedProps = { style: [styles.subtext, this.subtextStyle(), node.props.style]}; } return React.cloneElement(node, updatedProps); } else { - return <Label style={this.textStyle()}>{children}</Label>; + return <Label style={[styles.label, this.textStyle()]}>{children}</Label>; } }) } |
