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/AppButton.js | |
| parent | 7ed21c2ae70a875029715d4d4c10a1c59508d6fa (diff) | |
| download | mullvadvpn-89eeb129f065d92a82393db2deca58c0c0f2ff38.tar.xz mullvadvpn-89eeb129f065d92a82393db2deca58c0c0f2ff38.zip | |
Refactoring stuff, removed Icon
Diffstat (limited to 'app/components/styled/AppButton.js')
| -rw-r--r-- | app/components/styled/AppButton.js | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/app/components/styled/AppButton.js b/app/components/styled/AppButton.js index 1b113d36d4..60da8edb3c 100644 --- a/app/components/styled/AppButton.js +++ b/app/components/styled/AppButton.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({ @@ -61,8 +60,20 @@ const styles = { justifyContent: 'center', }, }), + ...createTextStyles({ + label:{ + alignSelf: 'center', + fontFamily: 'DINPro', + fontSize: 20, + fontWeight: '900', + lineHeight: 26, + flex: 1, + }, + }), }; +export class Label extends Text {} + export default class BaseButton extends Component { props: { children: Array<React.Element<*>> | React.Element<*>, @@ -90,16 +101,16 @@ export default class BaseButton extends Component { let updatedProps = {}; if(node.type.name === 'Label') { - updatedProps = { style: this.textStyle() }; + updatedProps = { style: [styles.label, this.textStyle()]}; } - if(node.type.name === 'Icon') { - updatedProps = { style: [styles.icon, this.iconStyle()]}; + if(node.type.name === 'Img') { + updatedProps = { tintColor:'currentColor', style: [styles.icon, this.iconStyle()]}; } return React.cloneElement(node, updatedProps); } else { - return <Label style={this.textStyle()}>{children}</Label>; + return <Label style={[styles.label, this.textStyle()]}>{children}</Label>; } }) } |
