Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -14,18 +14,18 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import React from "react";
|
||||
import classNames from "classnames";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
||||
import { _t } from '../../../languageHandler';
|
||||
import Modal from '../../../Modal';
|
||||
import { _t } from "../../../languageHandler";
|
||||
import Modal from "../../../Modal";
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
import BugReportDialog from '../dialogs/BugReportDialog';
|
||||
import AccessibleButton from '../elements/AccessibleButton';
|
||||
import BugReportDialog from "../dialogs/BugReportDialog";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import ViewSource from "../../structures/ViewSource";
|
||||
import { Layout } from '../../../settings/enums/Layout';
|
||||
import { Layout } from "../../../settings/enums/Layout";
|
||||
|
||||
interface IProps {
|
||||
mxEvent: MatrixEvent;
|
||||
|
@ -53,15 +53,19 @@ export default class TileErrorBoundary extends React.Component<IProps, IState> {
|
|||
|
||||
private onBugReport = (): void => {
|
||||
Modal.createDialog(BugReportDialog, {
|
||||
label: 'react-soft-crash-tile',
|
||||
label: "react-soft-crash-tile",
|
||||
error: this.state.error,
|
||||
});
|
||||
};
|
||||
|
||||
private onViewSource = (): void => {
|
||||
Modal.createDialog(ViewSource, {
|
||||
mxEvent: this.props.mxEvent,
|
||||
}, 'mx_Dialog_viewsource');
|
||||
Modal.createDialog(
|
||||
ViewSource,
|
||||
{
|
||||
mxEvent: this.props.mxEvent,
|
||||
},
|
||||
"mx_Dialog_viewsource",
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
@ -76,34 +80,40 @@ export default class TileErrorBoundary extends React.Component<IProps, IState> {
|
|||
|
||||
let submitLogsButton;
|
||||
if (SdkConfig.get().bug_report_endpoint_url) {
|
||||
submitLogsButton = <>
|
||||
|
||||
<AccessibleButton kind="link" onClick={this.onBugReport}>
|
||||
{ _t("Submit logs") }
|
||||
</AccessibleButton>
|
||||
</>;
|
||||
submitLogsButton = (
|
||||
<>
|
||||
|
||||
<AccessibleButton kind="link" onClick={this.onBugReport}>
|
||||
{_t("Submit logs")}
|
||||
</AccessibleButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
let viewSourceButton;
|
||||
if (mxEvent && SettingsStore.getValue("developerMode")) {
|
||||
viewSourceButton = <>
|
||||
|
||||
<AccessibleButton onClick={this.onViewSource} kind="link">
|
||||
{ _t("View Source") }
|
||||
</AccessibleButton>
|
||||
</>;
|
||||
viewSourceButton = (
|
||||
<>
|
||||
|
||||
<AccessibleButton onClick={this.onViewSource} kind="link">
|
||||
{_t("View Source")}
|
||||
</AccessibleButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (<li className={classNames(classes)} data-layout={this.props.layout}>
|
||||
<div className="mx_EventTile_line">
|
||||
<span>
|
||||
{ _t("Can't load this message") }
|
||||
{ mxEvent && ` (${mxEvent.getType()})` }
|
||||
{ submitLogsButton }
|
||||
{ viewSourceButton }
|
||||
</span>
|
||||
</div>
|
||||
</li>);
|
||||
return (
|
||||
<li className={classNames(classes)} data-layout={this.props.layout}>
|
||||
<div className="mx_EventTile_line">
|
||||
<span>
|
||||
{_t("Can't load this message")}
|
||||
{mxEvent && ` (${mxEvent.getType()})`}
|
||||
{submitLogsButton}
|
||||
{viewSourceButton}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
return this.props.children;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue