Skip to content

Commit

Permalink
Editor: Fix React unknown props warnings in EditorAuthor wrapper (Aut…
Browse files Browse the repository at this point in the history
…omattic#13467)

* Editor: Fix React unknown props warnings in EditorAuthor wrapper

* Editor: Use a ternary for EditorAuthor wrapper props
  • Loading branch information
tyxla authored Apr 28, 2017
1 parent a1f20d2 commit 1230dc8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/post-editor/editor-author/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,17 @@ export class EditorAuthor extends Component {
const name = author.display_name || author.name;
const Wrapper = this.userCanAssignAuthor() ? AuthorSelector : 'div';
const popoverPosition = touchDetect.hasTouch() ? 'bottom right' : 'bottom left';
const wrapperProps = this.userCanAssignAuthor()
? {
siteId: post.site_ID,
onSelect: this.onSelect,
popoverPosition,
}
: {};

return (
<div className="editor-author">
<Wrapper siteId={ post.site_ID } onSelect={ this.onSelect } popoverPosition={ popoverPosition }>
<Wrapper { ...wrapperProps }>
<Gravatar size={ 26 } user={ author } />
<span className="editor-author__name">
{ translate( 'by %(name)s', { args: { name: name } } ) }
Expand Down

0 comments on commit 1230dc8

Please sign in to comment.