diff options
author | Florian Orben <florian.orben@gmail.com> | 2015-11-17 19:01:26 +0100 |
---|---|---|
committer | Florian Orben <florian.orben@gmail.com> | 2015-11-27 23:17:45 +0100 |
commit | ca3856ab3b7d47b42b46db176c6678a24c1fc402 (patch) | |
tree | 7a838ad406b32e3d13d1417215df2273fb8e1676 /web | |
parent | 6e1e5f7ae4dcc5645a5412e17b36e5d95bf4f7c6 (diff) | |
download | chat-ca3856ab3b7d47b42b46db176c6678a24c1fc402.tar.gz chat-ca3856ab3b7d47b42b46db176c6678a24c1fc402.tar.bz2 chat-ca3856ab3b7d47b42b46db176c6678a24c1fc402.zip |
move preview-link-toggle outside of component markup
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/textbox.jsx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index e2868e946..1e9e912a8 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -303,7 +303,19 @@ export default class Textbox extends React.Component { } render() { - const previewLinkVisible = this.props.messageText.length > 0; + let previewLink = null; + if (Utils.featureToggle('#1389')) { + const previewLinkVisible = this.props.messageText.length > 0; + previewLink = ( + <a + style={{visibility: previewLinkVisible ? 'visible' : 'hidden'}} + onClick={this.showPreview} + className='textbox-preview-link' + > + {this.state.preview ? 'Edit message' : 'Preview'} + </a> + ); + } return ( <div @@ -342,19 +354,13 @@ export default class Textbox extends React.Component { dangerouslySetInnerHTML={{__html: this.state.preview ? TextFormatting.formatText(this.props.messageText) : ''}} > </div> + {previewLink} <a onClick={this.showHelp} className='textbox-help-link' > {'Help'} </a> - <a - style={{visibility: previewLinkVisible ? 'visible' : 'hidden'}} - onClick={this.showPreview} - className='textbox-preview-link' - > - {this.state.preview ? 'Edit' : 'Preview'} - </a> </div> ); } |