Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -49,13 +49,15 @@ const GenericExpiringToast: React.FC<IProps> = ({
|
|||
rejectLabel += ` (${counter})`;
|
||||
}
|
||||
|
||||
return <GenericToast
|
||||
description={description}
|
||||
acceptLabel={acceptLabel}
|
||||
onAccept={onAccept}
|
||||
rejectLabel={rejectLabel}
|
||||
onReject={onReject}
|
||||
/>;
|
||||
return (
|
||||
<GenericToast
|
||||
description={description}
|
||||
acceptLabel={acceptLabel}
|
||||
onAccept={onAccept}
|
||||
rejectLabel={rejectLabel}
|
||||
onReject={onReject}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default GenericExpiringToast;
|
||||
|
|
|
@ -40,24 +40,26 @@ const GenericToast: React.FC<XOR<IPropsExtended, IProps>> = ({
|
|||
onAccept,
|
||||
onReject,
|
||||
}) => {
|
||||
const detailContent = detail ? <div className="mx_Toast_detail">
|
||||
{ detail }
|
||||
</div> : null;
|
||||
const detailContent = detail ? <div className="mx_Toast_detail">{detail}</div> : null;
|
||||
|
||||
return <div>
|
||||
<div className="mx_Toast_description">
|
||||
{ description }
|
||||
{ detailContent }
|
||||
return (
|
||||
<div>
|
||||
<div className="mx_Toast_description">
|
||||
{description}
|
||||
{detailContent}
|
||||
</div>
|
||||
<div className="mx_Toast_buttons" aria-live="off">
|
||||
{onReject && rejectLabel && (
|
||||
<AccessibleButton kind="danger_outline" onClick={onReject}>
|
||||
{rejectLabel}
|
||||
</AccessibleButton>
|
||||
)}
|
||||
<AccessibleButton onClick={onAccept} kind="primary">
|
||||
{acceptLabel}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mx_Toast_buttons" aria-live="off">
|
||||
{ onReject && rejectLabel && <AccessibleButton kind="danger_outline" onClick={onReject}>
|
||||
{ rejectLabel }
|
||||
</AccessibleButton> }
|
||||
<AccessibleButton onClick={onAccept} kind="primary">
|
||||
{ acceptLabel }
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</div>;
|
||||
);
|
||||
};
|
||||
|
||||
export default GenericToast;
|
||||
|
|
|
@ -30,11 +30,17 @@ export default class NonUrgentEchoFailureToast extends React.PureComponent {
|
|||
return (
|
||||
<div className="mx_NonUrgentEchoFailureToast">
|
||||
<span className="mx_NonUrgentEchoFailureToast_icon" />
|
||||
{ _t("Your server isn't responding to some <a>requests</a>.", {}, {
|
||||
'a': (sub) => (
|
||||
<AccessibleButton kind="link_inline" onClick={this.openDialog}>{ sub }</AccessibleButton>
|
||||
),
|
||||
}) }
|
||||
{_t(
|
||||
"Your server isn't responding to some <a>requests</a>.",
|
||||
{},
|
||||
{
|
||||
a: (sub) => (
|
||||
<AccessibleButton kind="link_inline" onClick={this.openDialog}>
|
||||
{sub}
|
||||
</AccessibleButton>
|
||||
),
|
||||
},
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ import {
|
|||
import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { _t } from '../../../languageHandler';
|
||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||
import { RightPanelPhases } from '../../../stores/right-panel/RightPanelStorePhases';
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases";
|
||||
import { userLabelForEventRoom } from "../../../utils/KeyVerificationStateObserver";
|
||||
import dis from "../../../dispatcher/dispatcher";
|
||||
import ToastStore from "../../../stores/ToastStore";
|
||||
|
@ -129,12 +129,18 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
request.channel.roomId,
|
||||
);
|
||||
} else {
|
||||
Modal.createDialog(VerificationRequestDialog, {
|
||||
verificationRequest: request,
|
||||
onFinished: () => {
|
||||
request.cancel();
|
||||
Modal.createDialog(
|
||||
VerificationRequestDialog,
|
||||
{
|
||||
verificationRequest: request,
|
||||
onFinished: () => {
|
||||
request.cancel();
|
||||
},
|
||||
},
|
||||
}, null, /* priority = */ false, /* static = */ true);
|
||||
null,
|
||||
/* priority = */ false,
|
||||
/* static = */ true,
|
||||
);
|
||||
}
|
||||
await request.accept();
|
||||
} catch (err) {
|
||||
|
@ -167,17 +173,18 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
}
|
||||
}
|
||||
}
|
||||
const declineLabel = this.state.counter === 0 ?
|
||||
_t("Decline") :
|
||||
_t("Decline (%(counter)s)", { counter: this.state.counter });
|
||||
const declineLabel =
|
||||
this.state.counter === 0 ? _t("Decline") : _t("Decline (%(counter)s)", { counter: this.state.counter });
|
||||
|
||||
return <GenericToast
|
||||
description={description}
|
||||
detail={detail}
|
||||
acceptLabel={_t("Accept")}
|
||||
onAccept={this.accept}
|
||||
rejectLabel={declineLabel}
|
||||
onReject={this.cancel}
|
||||
/>;
|
||||
return (
|
||||
<GenericToast
|
||||
description={description}
|
||||
detail={detail}
|
||||
acceptLabel={_t("Accept")}
|
||||
onAccept={this.accept}
|
||||
rejectLabel={declineLabel}
|
||||
onReject={this.cancel}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue