[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,19 +1,19 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import PropTypes from "prop-types";
|
||||
import { PureComponent } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
|
||||
import { fromJS } from 'immutable';
|
||||
import { fromJS } from "immutable";
|
||||
|
||||
import { ImmutableHashtag as Hashtag } from 'mastodon/components/hashtag';
|
||||
import MediaGallery from 'mastodon/components/media_gallery';
|
||||
import ModalRoot from 'mastodon/components/modal_root';
|
||||
import Poll from 'mastodon/components/poll';
|
||||
import Audio from 'mastodon/features/audio';
|
||||
import Card from 'mastodon/features/status/components/card';
|
||||
import MediaModal from 'mastodon/features/ui/components/media_modal';
|
||||
import Video from 'mastodon/features/video';
|
||||
import { IntlProvider } from 'mastodon/locales';
|
||||
import { getScrollbarWidth } from 'mastodon/utils/scrollbar';
|
||||
import { ImmutableHashtag as Hashtag } from "mastodon/components/hashtag";
|
||||
import MediaGallery from "mastodon/components/media_gallery";
|
||||
import ModalRoot from "mastodon/components/modal_root";
|
||||
import Poll from "mastodon/components/poll";
|
||||
import Audio from "mastodon/features/audio";
|
||||
import Card from "mastodon/features/status/components/card";
|
||||
import MediaModal from "mastodon/features/ui/components/media_modal";
|
||||
import Video from "mastodon/features/video";
|
||||
import { IntlProvider } from "mastodon/locales";
|
||||
import { getScrollbarWidth } from "mastodon/utils/scrollbar";
|
||||
|
||||
const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll, Hashtag, Audio };
|
||||
|
||||
@@ -33,7 +33,7 @@ export default class MediaContainer extends PureComponent {
|
||||
};
|
||||
|
||||
handleOpenMedia = (media, index, lang) => {
|
||||
document.body.classList.add('with-modals--active');
|
||||
document.body.classList.add("with-modals--active");
|
||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||
|
||||
this.setState({ media, index, lang });
|
||||
@@ -41,18 +41,18 @@ export default class MediaContainer extends PureComponent {
|
||||
|
||||
handleOpenVideo = (lang, options) => {
|
||||
const { components } = this.props;
|
||||
const { media } = JSON.parse(components[options.componentIndex].getAttribute('data-props'));
|
||||
const { media } = JSON.parse(components[options.componentIndex].getAttribute("data-props"));
|
||||
const mediaList = fromJS(media);
|
||||
|
||||
document.body.classList.add('with-modals--active');
|
||||
document.body.classList.add("with-modals--active");
|
||||
document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
|
||||
|
||||
this.setState({ media: mediaList, lang, options });
|
||||
};
|
||||
|
||||
handleCloseMedia = () => {
|
||||
document.body.classList.remove('with-modals--active');
|
||||
document.documentElement.style.marginRight = '0';
|
||||
document.body.classList.remove("with-modals--active");
|
||||
document.documentElement.style.marginRight = "0";
|
||||
|
||||
this.setState({
|
||||
media: null,
|
||||
@@ -81,9 +81,9 @@ export default class MediaContainer extends PureComponent {
|
||||
<IntlProvider>
|
||||
<>
|
||||
{[].map.call(components, (component, i) => {
|
||||
const componentName = component.getAttribute('data-component');
|
||||
const componentName = component.getAttribute("data-component");
|
||||
const Component = MEDIA_COMPONENTS[componentName];
|
||||
const { media, card, poll, hashtag, ...props } = JSON.parse(component.getAttribute('data-props'));
|
||||
const { media, card, poll, hashtag, ...props } = JSON.parse(component.getAttribute("data-props"));
|
||||
|
||||
Object.assign(props, {
|
||||
...(media ? { media: fromJS(media) } : {}),
|
||||
@@ -91,7 +91,7 @@ export default class MediaContainer extends PureComponent {
|
||||
...(poll ? { poll: fromJS(poll) } : {}),
|
||||
...(hashtag ? { hashtag: fromJS(hashtag) } : {}),
|
||||
|
||||
...(componentName === 'Video' ? {
|
||||
...(componentName === "Video" ? {
|
||||
componentIndex: i,
|
||||
onOpenVideo: handleOpenVideo,
|
||||
} : {
|
||||
|
||||
Reference in New Issue
Block a user