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;
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,
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;
allLanguages={[]}
siteLanguages={[]}
hideNavigationWarnings
+ onReplyCancel={() => handleCancel()}
+ replyType={this.props.replyType}
buttonTitle={
this.props.privateMessageView
? capitalizeFirstLetter(I18NextService.i18n.t("save"))
/>
</div>
</div>
-
- <div className="mb-3 d-flex justify-content-end">
- {this.props.privateMessageView && (
- <button
- type="button"
- className="btn btn-secondary w-auto"
- onClick={linkEvent(this, this.handleCancel)}
- >
- {I18NextService.i18n.t("cancel")}
- </button>
- )}
- </div>
</form>
);
}
<>
<li className="list-inline-item">
<button
+ type="button"
className="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleMarkRead)}
data-tippy-content={
<li className="list-inline-item">{this.reportButton}</li>
<li className="list-inline-item">
<button
+ type="button"
className="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleReplyClick)}
data-tippy-content={I18NextService.i18n.t("reply")}
<>
<li className="list-inline-item">
<button
+ type="button"
className="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleEditClick)}
data-tippy-content={I18NextService.i18n.t("edit")}
</li>
<li className="list-inline-item">
<button
+ type="button"
className="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleDeleteClick)}
data-tippy-content={
)}
<li className="list-inline-item">
<button
+ type="button"
className="btn btn-link btn-animate text-muted"
onClick={linkEvent(this, this.handleViewSource)}
data-tippy-content={I18NextService.i18n.t("view_source")}
</form>
)}
{this.state.showReply && (
- <PrivateMessageForm
- recipient={otherPerson}
- onCreate={this.props.onCreate}
- />
+ <div className="row">
+ <div className="col-sm-6">
+ <PrivateMessageForm
+ privateMessageView={message_view}
+ replyType={true}
+ recipient={otherPerson}
+ onCreate={this.props.onCreate}
+ onCancel={this.handleReplyCancel}
+ />
+ </div>
+ </div>
)}
{/* A collapsed clearfix */}
{this.state.collapsed && <div className="row col-12"></div>}
get reportButton() {
return (
<button
+ type="button"
className="btn btn-link btn-animate text-muted py-0"
onClick={linkEvent(this, this.handleShowReportDialog)}
data-tippy-content={I18NextService.i18n.t("show_report_dialog")}