diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 73946ea8..97a26a74 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -23,15 +23,27 @@ 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 + */ replyType?: boolean; focus?: boolean; disabled?: boolean; finished?: boolean; + /** + * Whether to show the language selector + */ showLanguage?: boolean; hideNavigationWarnings?: boolean; onContentChange?(val: string): void; diff --git a/src/shared/components/private_message/private-message-form.tsx b/src/shared/components/private_message/private-message-form.tsx index 12fd9bd2..147269a5 100644 --- a/src/shared/components/private_message/private-message-form.tsx +++ b/src/shared/components/private_message/private-message-form.tsx @@ -1,6 +1,6 @@ import { myAuthRequired } from "@utils/app"; import { capitalizeFirstLetter } from "@utils/helpers"; -import { Component, InfernoNode, linkEvent } from "inferno"; +import { Component, InfernoNode } from "inferno"; import { T } from "inferno-i18next-dess"; import { CreatePrivateMessage, @@ -19,6 +19,7 @@ import { PersonListing } from "../person/person-listing"; interface PrivateMessageFormProps { recipient: Person; privateMessageView?: PrivateMessageView; // If a pm is given, that means this is an edit + replyType?: boolean; onCancel?(): any; onCreate?(form: CreatePrivateMessage): void; onEdit?(form: EditPrivateMessage): void; @@ -113,6 +114,8 @@ export class PrivateMessageForm extends Component< allLanguages={[]} siteLanguages={[]} hideNavigationWarnings + onReplyCancel={() => handleCancel()} + replyType={this.props.replyType} buttonTitle={ this.props.privateMessageView ? capitalizeFirstLetter(I18NextService.i18n.t("save")) @@ -121,18 +124,6 @@ export class PrivateMessageForm extends Component< /> - -