diff --git a/src/shared/components/common/icon.tsx b/src/shared/components/common/icon.tsx index 7aedee71..5b6ddf81 100644 --- a/src/shared/components/common/icon.tsx +++ b/src/shared/components/common/icon.tsx @@ -35,6 +35,7 @@ export class Icon extends Component { interface SpinnerProps { large?: boolean; + className?: string; } export class Spinner extends Component { @@ -46,7 +47,9 @@ export class Spinner extends Component { return ( ); } diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 2d306dca..25906097 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -23,15 +23,28 @@ import NavigationPrompt from "./navigation-prompt"; import ProgressBar from "./progress-bar"; interface MarkdownTextAreaProps { + /** + * Initial content inside the textarea + */ initialContent?: string; + /** + * Numerical ID of the language to select in dropdown + */ initialLanguageId?: number; placeholder?: string; buttonTitle?: string; maxLength?: number; + /** + * Whether this form is for a reply to a Private Message. + * If true, a "Cancel" button is shown that will close the reply. + */ replyType?: boolean; focus?: boolean; disabled?: boolean; finished?: boolean; + /** + * Whether to show the language selector + */ showLanguage?: boolean; hideNavigationWarnings?: boolean; onContentChange?(val: string): void; @@ -276,19 +289,6 @@ export class MarkdownTextArea extends Component< {/* A flex expander */}
- {this.props.buttonTitle && ( - - )} {this.props.replyType && ( + {this.props.buttonTitle && ( )} diff --git a/src/shared/components/private_message/create-private-message.tsx b/src/shared/components/private_message/create-private-message.tsx index 8afd3488..840a4425 100644 --- a/src/shared/components/private_message/create-private-message.tsx +++ b/src/shared/components/private_message/create-private-message.tsx @@ -115,7 +115,9 @@ export class CreatePrivateMessage extends Component< return (
-
{I18NextService.i18n.t("create_private_message")}
+

+ {I18NextService.i18n.t("create_private_message")} +

+
{!this.props.privateMessageView && ( -
+
-
+
)} +
+ + + # + + # + + +
{ + this.handlePrivateMessageSubmit(this, event); + }} initialContent={this.state.content} onContentChange={this.handleContentChange} allLanguages={[]} siteLanguages={[]} hideNavigationWarnings + onReplyCancel={() => this.handleCancel(this)} + replyType={this.props.replyType} + buttonTitle={ + this.props.privateMessageView + ? capitalizeFirstLetter(I18NextService.i18n.t("save")) + : capitalizeFirstLetter(I18NextService.i18n.t("send_message")) + } />
- - {this.state.showDisclaimer && ( -
-
-
- - # - - # - - -
-
-
- )} -
-
- - {this.props.privateMessageView && ( - - )} -
    -
  • -
-
-
); } @@ -200,8 +161,4 @@ export class PrivateMessageForm extends Component< event.preventDefault(); i.setState({ previewMode: !i.state.previewMode }); } - - handleShowDisclaimer(i: PrivateMessageForm) { - i.setState({ showDisclaimer: !i.state.showDisclaimer }); - } } diff --git a/src/shared/components/private_message/private-message.tsx b/src/shared/components/private_message/private-message.tsx index af8d64e5..110a908f 100644 --- a/src/shared/components/private_message/private-message.tsx +++ b/src/shared/components/private_message/private-message.tsx @@ -145,6 +145,7 @@ export class PrivateMessage extends Component< <>