diff options
author | jloup <jloup@jloup.work> | 2018-05-13 23:04:56 +0200 |
---|---|---|
committer | jloup <jloup@jloup.work> | 2018-05-13 23:06:04 +0200 |
commit | d5b8f0ffbbde5fb8d41c3abb4b0969b962746b52 (patch) | |
tree | 68ca44d82f27565edd1f88582fdbd5d4d8e9afd9 /cmd/web/js/panel.jsx | |
parent | cf5bb85cede5b05b58ed2b40460d0b913e8b2cf6 (diff) | |
download | Front-d5b8f0ffbbde5fb8d41c3abb4b0969b962746b52.tar.gz Front-d5b8f0ffbbde5fb8d41c3abb4b0969b962746b52.tar.zst Front-d5b8f0ffbbde5fb8d41c3abb4b0969b962746b52.zip |
JS factorization + clean.
Diffstat (limited to 'cmd/web/js/panel.jsx')
-rw-r--r-- | cmd/web/js/panel.jsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cmd/web/js/panel.jsx b/cmd/web/js/panel.jsx new file mode 100644 index 0000000..c293e9a --- /dev/null +++ b/cmd/web/js/panel.jsx | |||
@@ -0,0 +1,25 @@ | |||
1 | import React from 'react'; | ||
2 | import classnames from 'classnames'; | ||
3 | |||
4 | class Panel extends React.Component { | ||
5 | render = () => { | ||
6 | if (this.props.component === null) { | ||
7 | return <div></div>; | ||
8 | } | ||
9 | |||
10 | var className = classnames('row', this.props.topClassName); | ||
11 | |||
12 | return ( | ||
13 | <div className={className}> | ||
14 | <div className="box col-12"> | ||
15 | <div className="row"> | ||
16 | <div className="col-4">{this.props.title}</div> | ||
17 | </div> | ||
18 | <hr/> | ||
19 | {this.props.component} | ||
20 | </div> | ||
21 | </div>); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | export default Panel; | ||