diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-06-01 16:13:10 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-06-05 12:11:55 +0200 |
| commit | ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087 (patch) | |
| tree | b1f7754eb50896ab3681e35fa4e08be642b940c9 /app/components/HeaderBar.js | |
| parent | 5852c980980de53e00d76a0bdb4b41bf5c0f5b39 (diff) | |
| download | mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.tar.xz mullvadvpn-ca2f6fbfcad7b73d4ea63ef46cb1cab943ec9087.zip | |
Add formatted source code
Diffstat (limited to 'app/components/HeaderBar.js')
| -rw-r--r-- | app/components/HeaderBar.js | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/app/components/HeaderBar.js b/app/components/HeaderBar.js index 6f44ff7a00..4472b05dcc 100644 --- a/app/components/HeaderBar.js +++ b/app/components/HeaderBar.js @@ -1,11 +1,6 @@ // @flow import React from 'react'; -import { - Component, - Text, - Button, - View -} from 'reactxp'; +import { Component, Text, Button, View } from 'reactxp'; import Img from './Img'; @@ -14,10 +9,10 @@ import platformStyles from './HeaderBarPlatformStyles'; export type HeaderBarStyle = 'default' | 'defaultDark' | 'error' | 'success'; export type HeaderBarProps = { - style: HeaderBarStyle; - hidden: boolean; - showSettings: boolean; - onSettings: ?(() => void); + style: HeaderBarStyle, + hidden: boolean, + showSettings: boolean, + onSettings: ?() => void, }; export default class HeaderBar extends Component { @@ -26,34 +21,43 @@ export default class HeaderBar extends Component { style: 'default', hidden: false, showSettings: false, - onSettings: null + onSettings: null, }; render() { let containerClass = [ styles['headerbar'], platformStyles[process.platform], - styles['style_' + this.props.style] + styles['style_' + this.props.style], ]; - if(this.props.hidden) { + if (this.props.hidden) { containerClass.push(styles['hidden']); } return ( - <View style={ containerClass }> - {!this.props.hidden ? + <View style={containerClass}> + {!this.props.hidden ? ( <View style={styles.container} testName="headerbar__container"> - <Img height={50} width={50} source='logo-icon'/> + <Img height={50} width={50} source="logo-icon" /> <Text style={styles.title}>MULLVAD VPN</Text> </View> - : null} + ) : null} - {this.props.showSettings ? - <Button style={ styles.settings } onPress={ this.props.onSettings } testName="headerbar__settings"> - <Img height={24} width={24} source='icon-settings' style={[ styles.settings_icon, platformStyles.settings_icon ]} hoverStyle={ styles.settings_icon_hover }/> + {this.props.showSettings ? ( + <Button + style={styles.settings} + onPress={this.props.onSettings} + testName="headerbar__settings"> + <Img + height={24} + width={24} + source="icon-settings" + style={[styles.settings_icon, platformStyles.settings_icon]} + hoverStyle={styles.settings_icon_hover} + /> </Button> - : null} + ) : null} </View> ); } |
