diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-03-10 14:09:26 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-03-10 14:09:26 +0000 |
| commit | 767148f976f942bb68d4bc6c4d09b076aa6e39e0 (patch) | |
| tree | ded2073ba040fdf4cfa32c24757408c5de540517 /app | |
| parent | fcb95d50305c99368e2a19627ca1306a93888912 (diff) | |
| download | mullvadvpn-767148f976f942bb68d4bc6c4d09b076aa6e39e0.tar.xz mullvadvpn-767148f976f942bb68d4bc6c4d09b076aa6e39e0.zip | |
Update documentation
Diffstat (limited to 'app')
| -rw-r--r-- | app/components/Layout.js | 21 | ||||
| -rw-r--r-- | app/enums.js | 17 | ||||
| -rw-r--r-- | app/lib/enum.js | 7 |
3 files changed, 45 insertions, 0 deletions
diff --git a/app/components/Layout.js b/app/components/Layout.js index c4e66aed85..51215fe489 100644 --- a/app/components/Layout.js +++ b/app/components/Layout.js @@ -1,6 +1,13 @@ import React, { PropTypes, Component } from 'react'; import HeaderBar from './HeaderBar'; +/** + * Layout header + * + * @export + * @class Header + * @extends {Component} + */ export class Header extends Component { static Style = HeaderBar.Style @@ -14,6 +21,13 @@ export class Header extends Component { } } +/** + * Content container + * + * @export + * @class Container + * @extends {Component} + */ export class Container extends Component { static propTypes = { children: PropTypes.element.isRequired @@ -28,6 +42,13 @@ export class Container extends Component { } } +/** + * Layout container + * + * @export + * @class Layout + * @extends {Component} + */ export class Layout extends Component { static propTypes = { children: PropTypes.oneOfType([ diff --git a/app/enums.js b/app/enums.js index 87181f9525..b6ed213c57 100644 --- a/app/enums.js +++ b/app/enums.js @@ -1,4 +1,21 @@ import Enum from './lib/enum'; +/** + * Login state enum used for React components + * @type {enum} + * @property {string} none Initial state (not logged in) + * @property {string} connecting Attempting to log in + * @property {string} failed Failed to log in + * @property {string} ok Logged in + */ export const LoginState = Enum('none', 'connecting', 'failed', 'ok'); + +/** + * Connection state enum used for React components + * @type {enum} + * @property {string} disconnected Initial state (disconnected) + * @property {string} connecting Connecting + * @property {string} connected Connected + * @property {string} failed Failed to connect + */ export const ConnectionState = Enum('disconnected', 'connecting', 'connected', 'failed'); diff --git a/app/lib/enum.js b/app/lib/enum.js index 0655fc4288..1815a551f7 100644 --- a/app/lib/enum.js +++ b/app/lib/enum.js @@ -1,5 +1,12 @@ /** * Creates enum object with keys provided as arguments + * + * @constructor + * @type Enum + * @property {bool} isValid({string}) whether key is valid + * @param {...string} ... Enum keys + * @export + * @returns Enum */ export default function Enum() { let object = Object.create({}); |
