Apply prettier formatting
This commit is contained in:
@@ -23,7 +23,7 @@ import SyntaxHighlight from "../views/elements/SyntaxHighlight";
|
||||
import { _t } from "../../languageHandler";
|
||||
import MatrixClientContext from "../../contexts/MatrixClientContext";
|
||||
import { canEditContent } from "../../utils/EventUtils";
|
||||
import { MatrixClientPeg } from '../../MatrixClientPeg';
|
||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
||||
import { IDialogProps } from "../views/dialogs/IDialogProps";
|
||||
import BaseDialog from "../views/dialogs/BaseDialog";
|
||||
import { DevtoolsContext } from "../views/dialogs/devtools/BaseTool";
|
||||
@@ -75,26 +75,18 @@ export default class ViewSource extends React.Component<IProps, IState> {
|
||||
<>
|
||||
<details open className="mx_ViewSource_details">
|
||||
<summary>
|
||||
<span className="mx_ViewSource_heading">
|
||||
{ _t("Decrypted event source") }
|
||||
</span>
|
||||
<span className="mx_ViewSource_heading">{_t("Decrypted event source")}</span>
|
||||
</summary>
|
||||
<CopyableText getTextToCopy={copyDecryptedFunc}>
|
||||
<SyntaxHighlight language="json">
|
||||
{ stringify(decryptedEventSource) }
|
||||
</SyntaxHighlight>
|
||||
<SyntaxHighlight language="json">{stringify(decryptedEventSource)}</SyntaxHighlight>
|
||||
</CopyableText>
|
||||
</details>
|
||||
<details className="mx_ViewSource_details">
|
||||
<summary>
|
||||
<span className="mx_ViewSource_heading">
|
||||
{ _t("Original event source") }
|
||||
</span>
|
||||
<span className="mx_ViewSource_heading">{_t("Original event source")}</span>
|
||||
</summary>
|
||||
<CopyableText getTextToCopy={copyOriginalFunc}>
|
||||
<SyntaxHighlight language="json">
|
||||
{ stringify(originalEventSource) }
|
||||
</SyntaxHighlight>
|
||||
<SyntaxHighlight language="json">{stringify(originalEventSource)}</SyntaxHighlight>
|
||||
</CopyableText>
|
||||
</details>
|
||||
</>
|
||||
@@ -102,13 +94,9 @@ export default class ViewSource extends React.Component<IProps, IState> {
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<div className="mx_ViewSource_heading">
|
||||
{ _t("Original event source") }
|
||||
</div>
|
||||
<div className="mx_ViewSource_heading">{_t("Original event source")}</div>
|
||||
<CopyableText getTextToCopy={copyOriginalFunc}>
|
||||
<SyntaxHighlight language="json">
|
||||
{ stringify(originalEventSource) }
|
||||
</SyntaxHighlight>
|
||||
<SyntaxHighlight language="json">{stringify(originalEventSource)}</SyntaxHighlight>
|
||||
</CopyableText>
|
||||
</>
|
||||
);
|
||||
@@ -125,22 +113,22 @@ export default class ViewSource extends React.Component<IProps, IState> {
|
||||
if (isStateEvent) {
|
||||
return (
|
||||
<MatrixClientContext.Consumer>
|
||||
{ (cli) => (
|
||||
{(cli) => (
|
||||
<DevtoolsContext.Provider value={{ room: cli.getRoom(roomId) }}>
|
||||
<StateEventEditor onBack={this.onBack} mxEvent={mxEvent} />
|
||||
</DevtoolsContext.Provider>
|
||||
) }
|
||||
)}
|
||||
</MatrixClientContext.Consumer>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<MatrixClientContext.Consumer>
|
||||
{ (cli) => (
|
||||
{(cli) => (
|
||||
<DevtoolsContext.Provider value={{ room: cli.getRoom(roomId) }}>
|
||||
<TimelineEventEditor onBack={this.onBack} mxEvent={mxEvent} />
|
||||
</DevtoolsContext.Provider>
|
||||
) }
|
||||
)}
|
||||
</MatrixClientContext.Consumer>
|
||||
);
|
||||
}
|
||||
@@ -162,25 +150,25 @@ export default class ViewSource extends React.Component<IProps, IState> {
|
||||
<BaseDialog className="mx_ViewSource" onFinished={this.props.onFinished} title={_t("View Source")}>
|
||||
<div className="mx_ViewSource_header">
|
||||
<CopyableText getTextToCopy={() => roomId} border={false}>
|
||||
{ _t("Room ID: %(roomId)s", { roomId }) }
|
||||
{_t("Room ID: %(roomId)s", { roomId })}
|
||||
</CopyableText>
|
||||
<CopyableText getTextToCopy={() => eventId} border={false}>
|
||||
{ _t("Event ID: %(eventId)s", { eventId }) }
|
||||
{_t("Event ID: %(eventId)s", { eventId })}
|
||||
</CopyableText>
|
||||
{ mxEvent.threadRootId && (
|
||||
{mxEvent.threadRootId && (
|
||||
<CopyableText getTextToCopy={() => mxEvent.threadRootId!} border={false}>
|
||||
{ _t("Thread root ID: %(threadRootId)s", {
|
||||
{_t("Thread root ID: %(threadRootId)s", {
|
||||
threadRootId: mxEvent.threadRootId,
|
||||
}) }
|
||||
})}
|
||||
</CopyableText>
|
||||
) }
|
||||
)}
|
||||
</div>
|
||||
{ isEditing ? this.editSourceContent() : this.viewSourceContent() }
|
||||
{ !isEditing && canEdit && (
|
||||
{isEditing ? this.editSourceContent() : this.viewSourceContent()}
|
||||
{!isEditing && canEdit && (
|
||||
<div className="mx_Dialog_buttons">
|
||||
<button onClick={() => this.onEdit()}>{ _t("Edit") }</button>
|
||||
<button onClick={() => this.onEdit()}>{_t("Edit")}</button>
|
||||
</div>
|
||||
) }
|
||||
)}
|
||||
</BaseDialog>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user