Apply prettier formatting

This commit is contained in:
Michael Weimann 2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
1576 changed files with 65385 additions and 62478 deletions

View file

@ -18,7 +18,7 @@ limitations under the License.
import React from "react";
import { _t } from '../../../languageHandler';
import { _t } from "../../../languageHandler";
interface IProps {
// The primary button which is styled differently and has default focus.
@ -32,7 +32,7 @@ interface IProps {
// onClick handler for the primary button. Note that the returned promise, if
// returning a promise, is not used.
onPrimaryButtonClick?: (ev: React.MouseEvent) => (void | Promise<void>);
onPrimaryButtonClick?: (ev: React.MouseEvent) => void | Promise<void>;
// should there be a cancel button? default: true
hasCancel?: boolean;
@ -79,38 +79,41 @@ export default class DialogButtons extends React.Component<IProps> {
let cancelButton;
if (this.props.cancelButton || this.props.hasCancel) {
cancelButton = <button
// important: the default type is 'submit' and this button comes before the
// primary in the DOM so will get form submissions unless we make it not a submit.
data-testid="dialog-cancel-button"
type="button"
onClick={this.onCancelClick}
className={this.props.cancelButtonClass}
disabled={this.props.disabled}
>
{ this.props.cancelButton || _t("Cancel") }
</button>;
cancelButton = (
<button
// important: the default type is 'submit' and this button comes before the
// primary in the DOM so will get form submissions unless we make it not a submit.
data-testid="dialog-cancel-button"
type="button"
onClick={this.onCancelClick}
className={this.props.cancelButtonClass}
disabled={this.props.disabled}
>
{this.props.cancelButton || _t("Cancel")}
</button>
);
}
let additive = null;
if (this.props.additive) {
additive = <div className="mx_Dialog_buttons_additive">{ this.props.additive }</div>;
additive = <div className="mx_Dialog_buttons_additive">{this.props.additive}</div>;
}
return (
<div className="mx_Dialog_buttons">
{ additive }
{additive}
<span className="mx_Dialog_buttons_row">
{ cancelButton }
{ this.props.children }
<button type={this.props.primaryIsSubmit ? 'submit' : 'button'}
{cancelButton}
{this.props.children}
<button
type={this.props.primaryIsSubmit ? "submit" : "button"}
data-testid="dialog-primary-button"
className={primaryButtonClassName}
onClick={this.props.onPrimaryButtonClick}
autoFocus={this.props.focus}
disabled={this.props.disabled || this.props.primaryDisabled}
>
{ this.props.primaryButton }
{this.props.primaryButton}
</button>
</span>
</div>