Skip to content

Commit

Permalink
improve editor error styling
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart committed Dec 7, 2017
1 parent f7365ae commit f1e12cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/Editor/EditorControlPane/EditorControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default class EditorControl extends React.Component {
classNameWrapper={c({
'nc-controlPane-widget': true,
'nc-controlPane-widgetActive': this.state.styleActive,
'nc-controlPane-widgetError': !!errors,
})}
classNameWidget="nc-controlPane-widget"
classNameWidgetActive="nc-controlPane-widgetNestable"
Expand Down
9 changes: 7 additions & 2 deletions src/components/Editor/EditorControlPane/EditorControlPane.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ select.nc-controlPane-widget {
}

.nc-controlPane-labelWithError {
color: #FF706F;
background-color: var(--colorErrorText);
color: #fff;
}

.nc-controlPane-widgetError {
border-color: var(--colorErrorText);
}

.nc-controlPane-errors {
list-style-type: none;
font-size: 12px;
color: #FF706F;
color: var(--colorErrorText);
margin-bottom: 5px;
text-align: right;
text-transform: uppercase;
Expand Down
4 changes: 1 addition & 3 deletions src/components/Editor/EditorControlPane/Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class Widget extends Component {
return this.wrappedControlShouldComponentUpdate(nextProps);
}
return this.props.value !== nextProps.value
|| this.props.className !== nextProps.className
|| this.props.classNameWrapper !== nextProps.classNameWrapper
|| this.props.hasActiveStyle !== nextProps.hasActiveStyle;
}

Expand Down Expand Up @@ -174,7 +174,6 @@ export default class Widget extends Component {
onAddAsset,
onRemoveInsertedMedia,
getAsset,
className,
classNameWrapper,
classNameWidget,
classNameWidgetActive,
Expand All @@ -198,7 +197,6 @@ export default class Widget extends Component {
getAsset,
forID: field.get('name'),
ref: this.processInnerControlRef,
className,
classNameWrapper,
classNameWidget,
classNameWidgetActive,
Expand Down

0 comments on commit f1e12cb

Please sign in to comment.