[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,32 +1,32 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import { defineMessages, injectIntl } from "react-intl";
|
||||
|
||||
import classNames from 'classnames';
|
||||
import classNames from "classnames";
|
||||
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { connect } from 'react-redux';
|
||||
import ImmutablePropTypes from "react-immutable-proptypes";
|
||||
import ImmutablePureComponent from "react-immutable-pure-component";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { initBoostModal } from 'mastodon/actions/boosts';
|
||||
import { replyCompose } from 'mastodon/actions/compose';
|
||||
import { reblog, favourite, unreblog, unfavourite } from 'mastodon/actions/interactions';
|
||||
import { openModal } from 'mastodon/actions/modal';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { me, boostModal } from 'mastodon/initial_state';
|
||||
import { makeGetStatus } from 'mastodon/selectors';
|
||||
import { initBoostModal } from "mastodon/actions/boosts";
|
||||
import { replyCompose } from "mastodon/actions/compose";
|
||||
import { reblog, favourite, unreblog, unfavourite } from "mastodon/actions/interactions";
|
||||
import { openModal } from "mastodon/actions/modal";
|
||||
import { IconButton } from "mastodon/components/icon_button";
|
||||
import { me, boostModal } from "mastodon/initial_state";
|
||||
import { makeGetStatus } from "mastodon/selectors";
|
||||
|
||||
const messages = defineMessages({
|
||||
reply: { id: 'status.reply', defaultMessage: 'Reply' },
|
||||
replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
|
||||
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
|
||||
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
||||
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
||||
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
||||
favourite: { id: 'status.favourite', defaultMessage: 'Favorite' },
|
||||
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
|
||||
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
||||
open: { id: 'status.open', defaultMessage: 'Expand this status' },
|
||||
reply: { id: "status.reply", defaultMessage: "Reply" },
|
||||
replyAll: { id: "status.replyAll", defaultMessage: "Reply to thread" },
|
||||
reblog: { id: "status.reblog", defaultMessage: "Boost" },
|
||||
reblog_private: { id: "status.reblog_private", defaultMessage: "Boost with original visibility" },
|
||||
cancel_reblog_private: { id: "status.cancel_reblog_private", defaultMessage: "Unboost" },
|
||||
cannot_reblog: { id: "status.cannot_reblog", defaultMessage: "This post cannot be boosted" },
|
||||
favourite: { id: "status.favourite", defaultMessage: "Favorite" },
|
||||
replyConfirm: { id: "confirmations.reply.confirm", defaultMessage: "Reply" },
|
||||
replyMessage: { id: "confirmations.reply.message", defaultMessage: "Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?" },
|
||||
open: { id: "status.open", defaultMessage: "Expand this status" },
|
||||
});
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
@@ -34,7 +34,7 @@ const makeMapStateToProps = () => {
|
||||
|
||||
const mapStateToProps = (state, { statusId }) => ({
|
||||
status: getStatus(state, { id: statusId }),
|
||||
askReplyConfirmation: state.getIn(['compose', 'text']).trim().length !== 0,
|
||||
askReplyConfirmation: state.getIn(["compose", "text"]).trim().length !== 0,
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
@@ -75,7 +75,7 @@ class Footer extends ImmutablePureComponent {
|
||||
if (signedIn) {
|
||||
if (askReplyConfirmation) {
|
||||
dispatch(openModal({
|
||||
modalType: 'CONFIRM',
|
||||
modalType: "CONFIRM",
|
||||
modalProps: {
|
||||
message: intl.formatMessage(messages.replyMessage),
|
||||
confirm: intl.formatMessage(messages.replyConfirm),
|
||||
@@ -87,11 +87,11 @@ class Footer extends ImmutablePureComponent {
|
||||
}
|
||||
} else {
|
||||
dispatch(openModal({
|
||||
modalType: 'INTERACTION',
|
||||
modalType: "INTERACTION",
|
||||
modalProps: {
|
||||
type: 'reply',
|
||||
accountId: status.getIn(['account', 'id']),
|
||||
url: status.get('uri'),
|
||||
type: "reply",
|
||||
accountId: status.getIn(["account", "id"]),
|
||||
url: status.get("uri"),
|
||||
},
|
||||
}));
|
||||
}
|
||||
@@ -102,18 +102,18 @@ class Footer extends ImmutablePureComponent {
|
||||
const { signedIn } = this.context.identity;
|
||||
|
||||
if (signedIn) {
|
||||
if (status.get('favourited')) {
|
||||
if (status.get("favourited")) {
|
||||
dispatch(unfavourite(status));
|
||||
} else {
|
||||
dispatch(favourite(status));
|
||||
}
|
||||
} else {
|
||||
dispatch(openModal({
|
||||
modalType: 'INTERACTION',
|
||||
modalType: "INTERACTION",
|
||||
modalProps: {
|
||||
type: 'favourite',
|
||||
accountId: status.getIn(['account', 'id']),
|
||||
url: status.get('uri'),
|
||||
type: "favourite",
|
||||
accountId: status.getIn(["account", "id"]),
|
||||
url: status.get("uri"),
|
||||
},
|
||||
}));
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class Footer extends ImmutablePureComponent {
|
||||
const { signedIn } = this.context.identity;
|
||||
|
||||
if (signedIn) {
|
||||
if (status.get('reblogged')) {
|
||||
if (status.get("reblogged")) {
|
||||
dispatch(unreblog(status));
|
||||
} else if ((e && e.shiftKey) || !boostModal) {
|
||||
this._performReblog(status);
|
||||
@@ -138,11 +138,11 @@ class Footer extends ImmutablePureComponent {
|
||||
}
|
||||
} else {
|
||||
dispatch(openModal({
|
||||
modalType: 'INTERACTION',
|
||||
modalType: "INTERACTION",
|
||||
modalProps: {
|
||||
type: 'reblog',
|
||||
accountId: status.getIn(['account', 'id']),
|
||||
url: status.get('uri'),
|
||||
type: "reblog",
|
||||
accountId: status.getIn(["account", "id"]),
|
||||
url: status.get("uri"),
|
||||
},
|
||||
}));
|
||||
}
|
||||
@@ -161,28 +161,28 @@ class Footer extends ImmutablePureComponent {
|
||||
onClose();
|
||||
}
|
||||
|
||||
router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`);
|
||||
router.history.push(`/@${status.getIn(["account", "acct"])}/${status.get("id")}`);
|
||||
};
|
||||
|
||||
render () {
|
||||
const { status, intl, withOpenButton } = this.props;
|
||||
|
||||
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
|
||||
const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private';
|
||||
const publicStatus = ["public", "unlisted"].includes(status.get("visibility"));
|
||||
const reblogPrivate = status.getIn(["account", "id"]) === me && status.get("visibility") === "private";
|
||||
|
||||
let replyIcon, replyTitle;
|
||||
|
||||
if (status.get('in_reply_to_id', null) === null) {
|
||||
replyIcon = 'reply';
|
||||
if (status.get("in_reply_to_id", null) === null) {
|
||||
replyIcon = "reply";
|
||||
replyTitle = intl.formatMessage(messages.reply);
|
||||
} else {
|
||||
replyIcon = 'reply-all';
|
||||
replyIcon = "reply-all";
|
||||
replyTitle = intl.formatMessage(messages.replyAll);
|
||||
}
|
||||
|
||||
let reblogTitle = '';
|
||||
let reblogTitle;
|
||||
|
||||
if (status.get('reblogged')) {
|
||||
if (status.get("reblogged")) {
|
||||
reblogTitle = intl.formatMessage(messages.cancel_reblog_private);
|
||||
} else if (publicStatus) {
|
||||
reblogTitle = intl.formatMessage(messages.reblog);
|
||||
@@ -194,10 +194,10 @@ class Footer extends ImmutablePureComponent {
|
||||
|
||||
return (
|
||||
<div className='picture-in-picture__footer'>
|
||||
<IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} />
|
||||
<IconButton className={classNames('status__action-bar-button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={status.get('reblogs_count')} />
|
||||
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={status.get('favourites_count')} />
|
||||
{withOpenButton && <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.open)} icon='external-link' onClick={this.handleOpenClick} href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} />}
|
||||
<IconButton className='status__action-bar-button' title={replyTitle} icon={status.get("in_reply_to_account_id") === status.getIn(["account", "id"]) ? "reply" : replyIcon} onClick={this.handleReplyClick} counter={status.get("replies_count")} />
|
||||
<IconButton className={classNames("status__action-bar-button", { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get("reblogged")} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={status.get("reblogs_count")} />
|
||||
<IconButton className='status__action-bar-button star-icon' animate active={status.get("favourited")} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={status.get("favourites_count")} />
|
||||
{withOpenButton && <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.open)} icon='external-link' onClick={this.handleOpenClick} href={`/@${status.getIn(["account", "acct"])}/${status.get("id")}`} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import { defineMessages, injectIntl } from "react-intl";
|
||||
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { connect } from 'react-redux';
|
||||
import ImmutablePropTypes from "react-immutable-proptypes";
|
||||
import ImmutablePureComponent from "react-immutable-pure-component";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { Avatar } from 'mastodon/components/avatar';
|
||||
import { DisplayName } from 'mastodon/components/display_name';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { Avatar } from "mastodon/components/avatar";
|
||||
import { DisplayName } from "mastodon/components/display_name";
|
||||
import { IconButton } from "mastodon/components/icon_button";
|
||||
|
||||
const messages = defineMessages({
|
||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||
close: { id: "lightbox.close", defaultMessage: "Close" },
|
||||
});
|
||||
|
||||
const mapStateToProps = (state, { accountId }) => ({
|
||||
account: state.getIn(['accounts', accountId]),
|
||||
account: state.getIn(["accounts", accountId]),
|
||||
});
|
||||
|
||||
class Header extends ImmutablePureComponent {
|
||||
@@ -35,7 +35,7 @@ class Header extends ImmutablePureComponent {
|
||||
|
||||
return (
|
||||
<div className='picture-in-picture__header'>
|
||||
<Link to={`/@${account.get('acct')}/${statusId}`} className='picture-in-picture__header__account'>
|
||||
<Link to={`/@${account.get("acct")}/${statusId}`} className='picture-in-picture__header__account'>
|
||||
<Avatar account={account} size={36} />
|
||||
<DisplayName account={account} />
|
||||
</Link>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { Component } from 'react';
|
||||
import PropTypes from "prop-types";
|
||||
import { Component } from "react";
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
|
||||
import Audio from 'mastodon/features/audio';
|
||||
import Video from 'mastodon/features/video';
|
||||
import { removePictureInPicture } from "mastodon/actions/picture_in_picture";
|
||||
import Audio from "mastodon/features/audio";
|
||||
import Video from "mastodon/features/video";
|
||||
|
||||
import Footer from './components/footer';
|
||||
import Header from './components/header';
|
||||
import Footer from "./components/footer";
|
||||
import Header from "./components/header";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
...state.get('picture_in_picture'),
|
||||
...state.get("picture_in_picture"),
|
||||
});
|
||||
|
||||
class PictureInPicture extends Component {
|
||||
@@ -45,7 +45,7 @@ class PictureInPicture extends Component {
|
||||
|
||||
let player;
|
||||
|
||||
if (type === 'video') {
|
||||
if (type === "video") {
|
||||
player = (
|
||||
<Video
|
||||
src={src}
|
||||
@@ -57,7 +57,7 @@ class PictureInPicture extends Component {
|
||||
alwaysVisible
|
||||
/>
|
||||
);
|
||||
} else if (type === 'audio') {
|
||||
} else if (type === "audio") {
|
||||
player = (
|
||||
<Audio
|
||||
src={src}
|
||||
|
||||
Reference in New Issue
Block a user