[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
import PropTypes from "prop-types";
|
||||
import { PureComponent } from "react";
|
||||
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { Helmet } from "react-helmet";
|
||||
|
||||
import Base from 'mastodon/components/modal_root';
|
||||
import Base from "mastodon/components/modal_root";
|
||||
import {
|
||||
MuteModal,
|
||||
BlockModal,
|
||||
@@ -16,42 +16,42 @@ import {
|
||||
InteractionModal,
|
||||
SubscribedLanguagesModal,
|
||||
ClosedRegistrationsModal,
|
||||
} from 'mastodon/features/ui/util/async-components';
|
||||
import { getScrollbarWidth } from 'mastodon/utils/scrollbar';
|
||||
} from "mastodon/features/ui/util/async-components";
|
||||
import { getScrollbarWidth } from "mastodon/utils/scrollbar";
|
||||
|
||||
import BundleContainer from '../containers/bundle_container';
|
||||
import BundleContainer from "../containers/bundle_container";
|
||||
|
||||
import ActionsModal from './actions_modal';
|
||||
import AudioModal from './audio_modal';
|
||||
import BoostModal from './boost_modal';
|
||||
import BundleModalError from './bundle_modal_error';
|
||||
import ConfirmationModal from './confirmation_modal';
|
||||
import FocalPointModal from './focal_point_modal';
|
||||
import ImageModal from './image_modal';
|
||||
import MediaModal from './media_modal';
|
||||
import ModalLoading from './modal_loading';
|
||||
import VideoModal from './video_modal';
|
||||
import ActionsModal from "./actions_modal";
|
||||
import AudioModal from "./audio_modal";
|
||||
import BoostModal from "./boost_modal";
|
||||
import BundleModalError from "./bundle_modal_error";
|
||||
import ConfirmationModal from "./confirmation_modal";
|
||||
import FocalPointModal from "./focal_point_modal";
|
||||
import ImageModal from "./image_modal";
|
||||
import MediaModal from "./media_modal";
|
||||
import ModalLoading from "./modal_loading";
|
||||
import VideoModal from "./video_modal";
|
||||
|
||||
export const MODAL_COMPONENTS = {
|
||||
'MEDIA': () => Promise.resolve({ default: MediaModal }),
|
||||
'VIDEO': () => Promise.resolve({ default: VideoModal }),
|
||||
'AUDIO': () => Promise.resolve({ default: AudioModal }),
|
||||
'IMAGE': () => Promise.resolve({ default: ImageModal }),
|
||||
'BOOST': () => Promise.resolve({ default: BoostModal }),
|
||||
'CONFIRM': () => Promise.resolve({ default: ConfirmationModal }),
|
||||
'MUTE': MuteModal,
|
||||
'BLOCK': BlockModal,
|
||||
'REPORT': ReportModal,
|
||||
'ACTIONS': () => Promise.resolve({ default: ActionsModal }),
|
||||
'EMBED': EmbedModal,
|
||||
'LIST_EDITOR': ListEditor,
|
||||
'FOCAL_POINT': () => Promise.resolve({ default: FocalPointModal }),
|
||||
'LIST_ADDER': ListAdder,
|
||||
'COMPARE_HISTORY': CompareHistoryModal,
|
||||
'FILTER': FilterModal,
|
||||
'SUBSCRIBED_LANGUAGES': SubscribedLanguagesModal,
|
||||
'INTERACTION': InteractionModal,
|
||||
'CLOSED_REGISTRATIONS': ClosedRegistrationsModal,
|
||||
"MEDIA": () => Promise.resolve({ default: MediaModal }),
|
||||
"VIDEO": () => Promise.resolve({ default: VideoModal }),
|
||||
"AUDIO": () => Promise.resolve({ default: AudioModal }),
|
||||
"IMAGE": () => Promise.resolve({ default: ImageModal }),
|
||||
"BOOST": () => Promise.resolve({ default: BoostModal }),
|
||||
"CONFIRM": () => Promise.resolve({ default: ConfirmationModal }),
|
||||
"MUTE": MuteModal,
|
||||
"BLOCK": BlockModal,
|
||||
"REPORT": ReportModal,
|
||||
"ACTIONS": () => Promise.resolve({ default: ActionsModal }),
|
||||
"EMBED": EmbedModal,
|
||||
"LIST_EDITOR": ListEditor,
|
||||
"FOCAL_POINT": () => Promise.resolve({ default: FocalPointModal }),
|
||||
"LIST_ADDER": ListAdder,
|
||||
"COMPARE_HISTORY": CompareHistoryModal,
|
||||
"FILTER": FilterModal,
|
||||
"SUBSCRIBED_LANGUAGES": SubscribedLanguagesModal,
|
||||
"INTERACTION": InteractionModal,
|
||||
"CLOSED_REGISTRATIONS": ClosedRegistrationsModal,
|
||||
};
|
||||
|
||||
export default class ModalRoot extends PureComponent {
|
||||
@@ -73,11 +73,11 @@ export default class ModalRoot extends PureComponent {
|
||||
|
||||
componentDidUpdate (prevProps, prevState, { visible }) {
|
||||
if (visible) {
|
||||
document.body.classList.add('with-modals--active');
|
||||
document.body.classList.add("with-modals--active");
|
||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||
} else {
|
||||
document.body.classList.remove('with-modals--active');
|
||||
document.documentElement.style.marginRight = '0';
|
||||
document.body.classList.remove("with-modals--active");
|
||||
document.documentElement.style.marginRight = "0";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ export default class ModalRoot extends PureComponent {
|
||||
};
|
||||
|
||||
renderLoading = modalId => () => {
|
||||
return ['MEDIA', 'VIDEO', 'BOOST', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null;
|
||||
return ["MEDIA", "VIDEO", "BOOST", "CONFIRM", "ACTIONS"].indexOf(modalId) === -1 ? <ModalLoading /> : null;
|
||||
};
|
||||
|
||||
renderError = (props) => {
|
||||
@@ -116,7 +116,7 @@ export default class ModalRoot extends PureComponent {
|
||||
<>
|
||||
<BundleContainer fetchComponent={MODAL_COMPONENTS[type]} loading={this.renderLoading(type)} error={this.renderError} renderDelay={200}>
|
||||
{(SpecificComponent) => {
|
||||
const ref = typeof SpecificComponent !== 'function' ? this.setModalRef : undefined;
|
||||
const ref = typeof SpecificComponent !== "function" ? this.setModalRef : undefined;
|
||||
return <SpecificComponent {...props} onChangeBackgroundColor={this.setBackgroundColor} onClose={this.handleClose} ref={ref} />;
|
||||
}}
|
||||
</BundleContainer>
|
||||
|
||||
Reference in New Issue
Block a user