diff --git a/client/coral-embed-stream/src/tabs/stream/components/DraftArea.js b/client/coral-embed-stream/src/tabs/stream/components/DraftArea.js index 42c5eee6f..60bf18b40 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/DraftArea.js +++ b/client/coral-embed-stream/src/tabs/stream/components/DraftArea.js @@ -32,6 +32,20 @@ export default class DraftArea extends React.Component { ); } + getLabel() { + if (this.props.isEdit) { + return t('edit_comment.body_input_label'); + } + return this.props.isReply ? t('comment_box.reply') : t('comment.comment'); + } + + getPlaceholder() { + if (this.props.isEdit) { + return ''; + } + return this.getLabel(); + } + render() { const { input, @@ -68,6 +82,8 @@ export default class DraftArea extends React.Component { disabled, isReply, isEdit, + placeholder: this.getPlaceholder(), + label: this.getLabel(), }} /> {/* Is this slot here legitimate? (kiwi) */} diff --git a/client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js b/client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js index 2639d5b2d..74e59f795 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js +++ b/client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js @@ -2,25 +2,17 @@ import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './DraftAreaContent.css'; -import t from 'coral-framework/services/i18n'; class DraftAreaContent extends React.Component { - getLabel() { - if (this.props.isEdit) { - return t('edit_comment.body_input_label'); - } - return this.props.isReply ? t('comment_box.reply') : t('comment.comment'); - } - - getPlaceholder() { - if (this.props.isEdit) { - return ''; - } - return this.getLabel(); - } - render() { - const { input, id, onInputChange, disabled } = this.props; + const { + input, + id, + onInputChange, + disabled, + label, + placeholder, + } = this.props; const inputId = `${id}-textarea`; return (
@@ -29,13 +21,13 @@ class DraftAreaContent extends React.Component { className="screen-reader-text" aria-hidden={true} > - {this.getLabel()} + {label}