summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/components/Account.js2
-rw-r--r--app/components/Connect.js9
-rw-r--r--app/components/HeaderBar.js53
-rw-r--r--app/components/Layout.js7
-rw-r--r--app/components/SelectLocation.js2
-rw-r--r--app/components/Settings.js2
6 files changed, 22 insertions, 53 deletions
diff --git a/app/components/Account.js b/app/components/Account.js
index 7f4747ec4b..fe38439e7a 100644
--- a/app/components/Account.js
+++ b/app/components/Account.js
@@ -33,7 +33,7 @@ export default class Account extends Component {
return (
<Layout>
- <Header hidden={ true } style={ Header.Style.defaultDark } />
+ <Header hidden={ true } style={ 'defaultDark' } />
<Container>
<div className="account">
<div className="account__close" onClick={ ::this.onClose }>
diff --git a/app/components/Connect.js b/app/components/Connect.js
index 1859fe485e..c060986af3 100644
--- a/app/components/Connect.js
+++ b/app/components/Connect.js
@@ -10,6 +10,8 @@ import Backend from '../lib/backend';
import { ConnectionState } from '../enums';
import ExternalLinkSVG from '../assets/images/icon-extLink.svg';
+import type HeaderBarStyle from './HeaderBar';
+
export default class Connect extends Component {
static propTypes = {
@@ -334,14 +336,13 @@ export default class Connect extends Component {
// Private
- headerStyle() {
- const S = Header.Style;
+ headerStyle(): HeaderBarStyle {
switch(this.props.connect.status) {
case ConnectionState.connecting:
case ConnectionState.disconnected:
- return S.error;
+ return 'error';
case ConnectionState.connected:
- return S.success;
+ return 'success';
}
}
diff --git a/app/components/HeaderBar.js b/app/components/HeaderBar.js
index 6bd0cc2b13..5574951a06 100644
--- a/app/components/HeaderBar.js
+++ b/app/components/HeaderBar.js
@@ -1,52 +1,27 @@
-import React, { Component, PropTypes } from 'react';
+// @flow
+import React, { Component } from 'react';
import { If, Then } from 'react-if';
-import Enum from '../lib/enum';
+
+export type HeaderBarStyle = 'default' | 'defaultDark' | 'error' | 'success';
/**
* Header bar component
- *
- * @export
- * @class HeaderBar
- * @extends {React.Component}
*/
export default class HeaderBar extends Component {
- /**
- * Bar style
- * @type {Style}
- * @property {string} default - default
- * @property {string} defaultDark - default dark blue
- * @property {string} error - red
- * @property {string} success - green
- * @static
- *
- * @memberOf HeaderBar
- */
- static Style = new Enum('default', 'defaultDark', 'error', 'success');
-
- /**
- * Prop types
- * @static
- *
- * @memberOf HeaderBar
- */
- static propTypes = {
- style: PropTypes.string,
- hidden: PropTypes.bool,
- showSettings: PropTypes.bool,
- onSettings: PropTypes.func
+ props: {
+ style: HeaderBarStyle,
+ hidden: boolean,
+ showSettings: boolean,
+ onSettings: () => void
};
- /**
- * @override
- */
render() {
- const style = this.props.style;
- let containerClass = ['headerbar', 'headerbar--' + process.platform];
-
- if(HeaderBar.Style.isValid(style)) {
- containerClass.push(`headerbar--style-${style}`);
- }
+ let containerClass = [
+ 'headerbar',
+ 'headerbar--' + process.platform,
+ 'headerbar--style-' + this.props.style
+ ];
if(this.props.hidden) {
containerClass.push('headerbar--hidden');
diff --git a/app/components/Layout.js b/app/components/Layout.js
index f3de35e374..36d298b5b8 100644
--- a/app/components/Layout.js
+++ b/app/components/Layout.js
@@ -11,13 +11,6 @@ import HeaderBar from './HeaderBar';
export class Header extends Component {
/**
- * @type {HeaderBar.Style}
- * @static
- * @memberOf Header
- */
- static Style = HeaderBar.Style;
-
- /**
* @override
*/
render() {
diff --git a/app/components/SelectLocation.js b/app/components/SelectLocation.js
index a495af7260..eb4191518e 100644
--- a/app/components/SelectLocation.js
+++ b/app/components/SelectLocation.js
@@ -67,7 +67,7 @@ export default class SelectLocation extends Component {
render() {
return (
<Layout>
- <Header hidden={ true } style={ Header.Style.defaultDark } />
+ <Header hidden={ true } style={ 'defaultDark' } />
<Container>
<div className="select-location">
<button className="select-location__close" onClick={ this.props.onClose } />
diff --git a/app/components/Settings.js b/app/components/Settings.js
index f31a8913ca..08a9af441b 100644
--- a/app/components/Settings.js
+++ b/app/components/Settings.js
@@ -46,7 +46,7 @@ export default class Settings extends Component {
return (
<Layout>
- <Header hidden={ true } style={ Header.Style.defaultDark } />
+ <Header hidden={ true } style={ 'defaultDark' } />
<Container>
<div className="settings">
<button className="settings__close" onClick={ ::this.onClose } />