From 507e8cbf728e9924bfceac0dcb4a29b9da841566 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Sat, 10 Jun 2017 20:07:40 +0200 Subject: [PATCH 1/3] IMPROVE design of addon-events --- addons/events/src/components/Event.js | 101 ++++++++++++++++---------- addons/events/src/components/Panel.js | 3 +- 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/addons/events/src/components/Event.js b/addons/events/src/components/Event.js index 35c93f3d607c..9e38218d5e24 100644 --- a/addons/events/src/components/Event.js +++ b/addons/events/src/components/Event.js @@ -4,37 +4,64 @@ import Textarea from 'react-textarea-autosize'; import PropTypes from 'prop-types'; const styles = { - item: { - padding: '10 0', - }, - buttonWrapper: { - textAlign: 'center', + label: { + display: 'table-cell', + boxSizing: 'border-box', + verticalAlign: 'top', + paddingRight: '5px', + paddingTop: '7px', + textAlign: 'right', + width: '100px', + fontSize: '12px', + color: 'rgb(68, 68, 68)', + fontWeight: '600', }, button: { - display: 'inline-block', - fontFamily: ` - -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", - "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif - `, - fontSize: 14, - padding: 10, - margin: 10, - width: '40%', + display: 'table-cell', + textTransform: 'uppercase', + letterSpacing: '3.5px', + fontSize: 12, + fontWeight: 'bolder', + color: 'rgb(130, 130, 130)', + border: '1px solid rgb(193, 193, 193)', + textAlign: 'center', + borderRadius: 2, + padding: 5, + cursor: 'pointer', + paddingLeft: 8, + margin: '0 0 0 5px', + backgroundColor: 'inherit', + verticalAlign: 'top', + outline: 0, }, textArea: { - display: 'block', + flex: '1 0 0', boxSizing: 'border-box', - margin: 0, - width: '100%', - maxWidth: '100%', - verticalAlign: 'middle', + margin: '0 0 0 5px', + verticalAlign: 'top', outline: 'none', border: '1px solid #c7c7c7', borderRadius: 2, fontSize: 13, - padding: '5px', + padding: '8px 5px 7px 8px', color: 'rgb(51, 51, 51)', fontFamily: 'Arial, sans-serif', + minHeight: '32px', + resize: 'vertical', + }, + item: { + display: 'flex', + padding: '5px', + alignItems: 'flex-start', + boxSizing: 'border-box', + width: '100%', + }, + hidden: { + display: 'none', + }, + failed: { + border: '1px solid #fadddd', + backgroundColor: '#fff5f5', }, }; @@ -100,37 +127,33 @@ export default class Item extends Component { }; render() { + const { title, name } = this.props; const { failed, isTextAreaShowed } = this.state; - const extraStyle = { - display: isTextAreaShowed ? 'block' : 'none', - }; - if (failed) { - extraStyle.border = '1px solid #fadddd'; - extraStyle.backgroundColor = '#fff5f5'; - } + const extraStyle = {}; + Object.assign(extraStyle, isTextAreaShowed ? {} : { ...styles.hidden }); + Object.assign(extraStyle, failed ? { ...styles.failed } : {}); return ( -
-

{this.props.title}

-
- - -
- +
+ +