mirror of https://github.com/vector-im/riot-web
chore: format, lint
parent
af5cfff51d
commit
288d98daed
|
@ -61,11 +61,7 @@ export default class ViewSource extends React.Component {
|
||||||
onBack={() => this.onBack()}
|
onBack={() => this.onBack()}
|
||||||
inputs={{
|
inputs={{
|
||||||
eventType: this.props.event.getType(),
|
eventType: this.props.event.getType(),
|
||||||
evContent: JSON.stringify(
|
evContent: JSON.stringify(this.props.event.getContent(), null, "\t"),
|
||||||
this.props.event.getContent(),
|
|
||||||
null,
|
|
||||||
"\t"
|
|
||||||
),
|
|
||||||
stateKey: this.props.event.getStateKey(),
|
stateKey: this.props.event.getStateKey(),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -97,11 +93,7 @@ export default class ViewSource extends React.Component {
|
||||||
onBack={() => this.onBack()}
|
onBack={() => this.onBack()}
|
||||||
inputs={{
|
inputs={{
|
||||||
eventType: this.props.event.getType(),
|
eventType: this.props.event.getType(),
|
||||||
evContent: JSON.stringify(
|
evContent: JSON.stringify(content, null, "\t"),
|
||||||
content,
|
|
||||||
null,
|
|
||||||
"\t"
|
|
||||||
),
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -120,39 +112,23 @@ export default class ViewSource extends React.Component {
|
||||||
<>
|
<>
|
||||||
<details open className="mx_ViewSource_details">
|
<details open className="mx_ViewSource_details">
|
||||||
<summary>
|
<summary>
|
||||||
<span className="mx_ViewSource_heading">
|
<span className="mx_ViewSource_heading">{_t("Decrypted event source")}</span>
|
||||||
{_t("Decrypted event source")}
|
|
||||||
</span>
|
|
||||||
</summary>
|
</summary>
|
||||||
<SyntaxHighlight className="json">
|
<SyntaxHighlight className="json">{JSON.stringify(this.props.decryptedContent, null, 2)}</SyntaxHighlight>
|
||||||
{JSON.stringify(
|
|
||||||
this.props.decryptedContent,
|
|
||||||
null,
|
|
||||||
2
|
|
||||||
)}
|
|
||||||
</SyntaxHighlight>
|
|
||||||
</details>
|
</details>
|
||||||
<details className="mx_ViewSource_details">
|
<details className="mx_ViewSource_details">
|
||||||
<summary>
|
<summary>
|
||||||
<span className="mx_ViewSource_heading">
|
<span className="mx_ViewSource_heading">{_t("Original event source")}</span>
|
||||||
{_t("Original event source")}
|
|
||||||
</span>
|
|
||||||
</summary>
|
</summary>
|
||||||
<SyntaxHighlight className="json">
|
<SyntaxHighlight className="json">{JSON.stringify(this.props.content, null, 2)}</SyntaxHighlight>
|
||||||
{JSON.stringify(this.props.content, null, 2)}
|
|
||||||
</SyntaxHighlight>
|
|
||||||
</details>
|
</details>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
content = (
|
content = (
|
||||||
<>
|
<>
|
||||||
<div className="mx_ViewSource_heading">
|
<div className="mx_ViewSource_heading">{_t("Original event source")}</div>
|
||||||
{_t("Original event source")}
|
<SyntaxHighlight className="json">{JSON.stringify(this.props.content, null, 2)}</SyntaxHighlight>
|
||||||
</div>
|
|
||||||
<SyntaxHighlight className="json">
|
|
||||||
{JSON.stringify(this.props.content, null, 2)}
|
|
||||||
</SyntaxHighlight>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -161,26 +137,16 @@ export default class ViewSource extends React.Component {
|
||||||
console.log(isEditing);
|
console.log(isEditing);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseDialog
|
<BaseDialog className="mx_ViewSource" onFinished={this.props.onFinished} title={_t("View Source")}>
|
||||||
className="mx_ViewSource"
|
|
||||||
onFinished={this.props.onFinished}
|
|
||||||
title={_t("View Source")}
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<div className="mx_ViewSource_label_left">
|
<div className="mx_ViewSource_label_left">Room ID: {this.props.roomId}</div>
|
||||||
Room ID: {this.props.roomId}
|
<div className="mx_ViewSource_label_left">Event ID: {this.props.eventId}</div>
|
||||||
</div>
|
|
||||||
<div className="mx_ViewSource_label_left">
|
|
||||||
Event ID: {this.props.eventId}
|
|
||||||
</div>
|
|
||||||
<div className="mx_ViewSource_separator" />
|
<div className="mx_ViewSource_separator" />
|
||||||
{isEditing ? this.state.editComponent : content}
|
{isEditing ? this.state.editComponent : content}
|
||||||
</div>
|
</div>
|
||||||
{!isEditing && (
|
{!isEditing && (
|
||||||
<div className="mx_Dialog_buttons">
|
<div className="mx_Dialog_buttons">
|
||||||
<button onClick={() => this.editEvent()}>
|
<button onClick={() => this.editEvent()}>{_t("Edit")}</button>
|
||||||
{_t("Edit")}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
|
|
@ -142,7 +142,7 @@ export class SendCustomEvent extends GenericEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
const showTglFlip = !this.state.message && !this.props.forceStateEvent && !this.props.forceGeneralEvent;
|
const showTglFlip = !this.state.message && !this.props.forceStateEvent && !this.props.forceGeneralEvent;
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<div className="mx_DevTools_content">
|
<div className="mx_DevTools_content">
|
||||||
<div className="mx_DevTools_eventTypeStateKeyGroup">
|
<div className="mx_DevTools_eventTypeStateKeyGroup">
|
||||||
|
|
Loading…
Reference in New Issue