From 10b0b4462107ecebffab4ce3eb0435d3c1b2dd24 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 29 Sep 2016 17:00:47 -0700 Subject: [feat] ui - allow users to change their passwords --- ui/app/components/main_panel/section_layout.js | 55 +++++++++++++++++++++----- 1 file changed, 46 insertions(+), 9 deletions(-) (limited to 'ui/app/components/main_panel/section_layout.js') diff --git a/ui/app/components/main_panel/section_layout.js b/ui/app/components/main_panel/section_layout.js index e7c6f2a..10c1bc1 100644 --- a/ui/app/components/main_panel/section_layout.js +++ b/ui/app/components/main_panel/section_layout.js @@ -4,13 +4,18 @@ // import React from 'react' +import { Button, Glyphicon } from 'react-bootstrap' export default class SectionLayout extends React.Component { static get defaultProps() {return{ - icon: null, - buttons: null, - status: null, + icon: null, // icon name + buttons: null, // button content + status: null, // must be one of: on, off, unknown, wait, disabled + header: null, // the first line content + body: null, // expanded content + message: null, // alert content + onExpand: null, // callback className: "", style: {} }} @@ -24,7 +29,21 @@ export default class SectionLayout extends React.Component { let status = null let icon = null let buttons = null + let expander = null + let body = null + if (this.props.onExpand) { + let glyph = this.props.body ? 'triangle-top' : 'triangle-bottom' + expander = ( +
+ +
+ ) + } else { + expander = ( +
+ ) + } if (this.props.status) { status = (
@@ -39,20 +58,38 @@ export default class SectionLayout extends React.Component {
) } - if (this.props.buttons) + if (this.props.buttons) { buttons = (
{this.props.buttons}
) + } + if (this.props.body || this.props.message) { + body = ( +
+ {this.props.message} + {this.props.body} +
+ ) + } + return(
- {icon} -
- {this.props.children} + {expander} +
+ {icon} +
+
+
+ {this.props.header} +
+ {buttons} +
+ {body} +
+ {status}
- {buttons} - {status}
) } -- cgit v1.2.3