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

@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { filesize } from 'filesize';
import React from 'react';
import { filesize } from "filesize";
import React from "react";
import { _t } from '../../../languageHandler';
import ContentMessages from '../../../ContentMessages';
import { _t } from "../../../languageHandler";
import ContentMessages from "../../../ContentMessages";
import BaseDialog from "./BaseDialog";
import DialogButtons from "../elements/DialogButtons";
import { IDialogProps } from "./IDialogProps";
@ -50,67 +50,77 @@ export default class UploadFailureDialog extends React.Component<IProps> {
if (this.props.totalFiles === 1 && this.props.badFiles.length === 1) {
message = _t(
"This file is <b>too large</b> to upload. " +
"The file size limit is %(limit)s but this file is %(sizeOfThisFile)s.",
"The file size limit is %(limit)s but this file is %(sizeOfThisFile)s.",
{
limit: filesize(this.props.contentMessages.getUploadLimit()),
sizeOfThisFile: filesize(this.props.badFiles[0].size),
}, {
b: sub => <b>{ sub }</b>,
},
{
b: (sub) => <b>{sub}</b>,
},
);
buttons = <DialogButtons primaryButton={_t('OK')}
hasCancel={false}
onPrimaryButtonClick={this.onCancelClick}
focus={true}
/>;
buttons = (
<DialogButtons
primaryButton={_t("OK")}
hasCancel={false}
onPrimaryButtonClick={this.onCancelClick}
focus={true}
/>
);
} else if (this.props.totalFiles === this.props.badFiles.length) {
message = _t(
"These files are <b>too large</b> to upload. " +
"The file size limit is %(limit)s.",
"These files are <b>too large</b> to upload. " + "The file size limit is %(limit)s.",
{
limit: filesize(this.props.contentMessages.getUploadLimit()),
}, {
b: sub => <b>{ sub }</b>,
},
{
b: (sub) => <b>{sub}</b>,
},
);
buttons = <DialogButtons primaryButton={_t('OK')}
hasCancel={false}
onPrimaryButtonClick={this.onCancelClick}
focus={true}
/>;
buttons = (
<DialogButtons
primaryButton={_t("OK")}
hasCancel={false}
onPrimaryButtonClick={this.onCancelClick}
focus={true}
/>
);
} else {
message = _t(
"Some files are <b>too large</b> to be uploaded. " +
"The file size limit is %(limit)s.",
"Some files are <b>too large</b> to be uploaded. " + "The file size limit is %(limit)s.",
{
limit: filesize(this.props.contentMessages.getUploadLimit()),
}, {
b: sub => <b>{ sub }</b>,
},
{
b: (sub) => <b>{sub}</b>,
},
);
const howManyOthers = this.props.totalFiles - this.props.badFiles.length;
buttons = <DialogButtons
primaryButton={_t('Upload %(count)s other files', { count: howManyOthers })}
onPrimaryButtonClick={this.onUploadClick}
hasCancel={true}
cancelButton={_t("Cancel All")}
onCancel={this.onCancelClick}
focus={true}
/>;
buttons = (
<DialogButtons
primaryButton={_t("Upload %(count)s other files", { count: howManyOthers })}
onPrimaryButtonClick={this.onUploadClick}
hasCancel={true}
cancelButton={_t("Cancel All")}
onCancel={this.onCancelClick}
focus={true}
/>
);
}
return (
<BaseDialog className='mx_UploadFailureDialog'
<BaseDialog
className="mx_UploadFailureDialog"
onFinished={this.onCancelClick}
title={_t("Upload Error")}
contentId='mx_Dialog_content'
contentId="mx_Dialog_content"
>
<div id='mx_Dialog_content'>
{ message }
{ preview }
<div id="mx_Dialog_content">
{message}
{preview}
</div>
{ buttons }
{buttons}
</BaseDialog>
);
}