[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:
+10
-10
@@ -1,17 +1,17 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
import PropTypes from "prop-types";
|
||||
import { PureComponent } from "react";
|
||||
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from "react-intl";
|
||||
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import ImmutablePropTypes from "react-immutable-proptypes";
|
||||
|
||||
import SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle';
|
||||
import SettingToggle from "flavours/glitch/features/notifications/components/setting_toggle";
|
||||
|
||||
import SettingText from '../../../components/setting_text';
|
||||
import SettingText from "../../../components/setting_text";
|
||||
|
||||
const messages = defineMessages({
|
||||
filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },
|
||||
settings: { id: 'home.settings', defaultMessage: 'Column settings' },
|
||||
filter_regex: { id: "home.column_settings.filter_regex", defaultMessage: "Filter out by regular expressions" },
|
||||
settings: { id: "home.settings", defaultMessage: "Column settings" },
|
||||
});
|
||||
|
||||
class ColumnSettings extends PureComponent {
|
||||
@@ -30,13 +30,13 @@ class ColumnSettings extends PureComponent {
|
||||
<span className='column-settings__section'><FormattedMessage id='home.column_settings.basic' defaultMessage='Basic' /></span>
|
||||
|
||||
<div className='column-settings__row'>
|
||||
<SettingToggle settings={settings} settingPath={['conversations']} onChange={onChange} label={<FormattedMessage id='direct.group_by_conversations' defaultMessage='Group by conversation' />} />
|
||||
<SettingToggle settings={settings} settingPath={["conversations"]} onChange={onChange} label={<FormattedMessage id='direct.group_by_conversations' defaultMessage='Group by conversation' />} />
|
||||
</div>
|
||||
|
||||
<span className='column-settings__section'><FormattedMessage id='home.column_settings.advanced' defaultMessage='Advanced' /></span>
|
||||
|
||||
<div className='column-settings__row'>
|
||||
<SettingText settings={settings} settingPath={['regex', 'body']} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} />
|
||||
<SettingText settings={settings} settingPath={["regex", "body"]} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
+38
-36
@@ -1,31 +1,31 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import { defineMessages, injectIntl, FormattedMessage } 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 ImmutablePropTypes from "react-immutable-proptypes";
|
||||
import ImmutablePureComponent from "react-immutable-pure-component";
|
||||
|
||||
import { HotKeys } from 'react-hotkeys';
|
||||
import { HotKeys } from "react-hotkeys";
|
||||
|
||||
import AttachmentList from 'flavours/glitch/components/attachment_list';
|
||||
import AvatarComposite from 'flavours/glitch/components/avatar_composite';
|
||||
import { IconButton } from 'flavours/glitch/components/icon_button';
|
||||
import Permalink from 'flavours/glitch/components/permalink';
|
||||
import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp';
|
||||
import StatusContent from 'flavours/glitch/components/status_content';
|
||||
import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';
|
||||
import { autoPlayGif } from 'flavours/glitch/initial_state';
|
||||
import AttachmentList from "flavours/glitch/components/attachment_list";
|
||||
import AvatarComposite from "flavours/glitch/components/avatar_composite";
|
||||
import { IconButton } from "flavours/glitch/components/icon_button";
|
||||
import Permalink from "flavours/glitch/components/permalink";
|
||||
import { RelativeTimestamp } from "flavours/glitch/components/relative_timestamp";
|
||||
import StatusContent from "flavours/glitch/components/status_content";
|
||||
import DropdownMenuContainer from "flavours/glitch/containers/dropdown_menu_container";
|
||||
import { autoPlayGif } from "flavours/glitch/initial_state";
|
||||
|
||||
const messages = defineMessages({
|
||||
more: { id: 'status.more', defaultMessage: 'More' },
|
||||
open: { id: 'conversation.open', defaultMessage: 'View conversation' },
|
||||
reply: { id: 'status.reply', defaultMessage: 'Reply' },
|
||||
markAsRead: { id: 'conversation.mark_as_read', defaultMessage: 'Mark as read' },
|
||||
delete: { id: 'conversation.delete', defaultMessage: 'Delete conversation' },
|
||||
muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },
|
||||
unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },
|
||||
more: { id: "status.more", defaultMessage: "More" },
|
||||
open: { id: "conversation.open", defaultMessage: "View conversation" },
|
||||
reply: { id: "status.reply", defaultMessage: "Reply" },
|
||||
markAsRead: { id: "conversation.mark_as_read", defaultMessage: "Mark as read" },
|
||||
delete: { id: "conversation.delete", defaultMessage: "Delete conversation" },
|
||||
muteConversation: { id: "status.mute_conversation", defaultMessage: "Mute conversation" },
|
||||
unmuteConversation: { id: "status.unmute_conversation", defaultMessage: "Unmute conversation" },
|
||||
});
|
||||
|
||||
class Conversation extends ImmutablePureComponent {
|
||||
@@ -54,14 +54,16 @@ class Conversation extends ImmutablePureComponent {
|
||||
parseClick = (e, destination) => {
|
||||
const { router } = this.context;
|
||||
const { lastStatus, unread, markRead } = this.props;
|
||||
if (!router) return;
|
||||
if (!router) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {
|
||||
if (destination === undefined) {
|
||||
if (unread) {
|
||||
markRead();
|
||||
}
|
||||
destination = `/statuses/${lastStatus.get('id')}`;
|
||||
destination = `/statuses/${lastStatus.get("id")}`;
|
||||
}
|
||||
router.history.push(destination);
|
||||
e.preventDefault();
|
||||
@@ -73,11 +75,11 @@ class Conversation extends ImmutablePureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
const emojis = currentTarget.querySelectorAll('.custom-emoji');
|
||||
const emojis = currentTarget.querySelectorAll(".custom-emoji");
|
||||
|
||||
for (var i = 0; i < emojis.length; i++) {
|
||||
let emoji = emojis[i];
|
||||
emoji.src = emoji.getAttribute('data-original');
|
||||
emoji.src = emoji.getAttribute("data-original");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -86,11 +88,11 @@ class Conversation extends ImmutablePureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
const emojis = currentTarget.querySelectorAll('.custom-emoji');
|
||||
const emojis = currentTarget.querySelectorAll(".custom-emoji");
|
||||
|
||||
for (var i = 0; i < emojis.length; i++) {
|
||||
let emoji = emojis[i];
|
||||
emoji.src = emoji.getAttribute('data-static');
|
||||
emoji.src = emoji.getAttribute("data-static");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -105,7 +107,7 @@ class Conversation extends ImmutablePureComponent {
|
||||
markRead();
|
||||
}
|
||||
|
||||
this.context.router.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`);
|
||||
this.context.router.history.push(`/@${lastStatus.getIn(["account", "acct"])}/${lastStatus.get("id")}`);
|
||||
};
|
||||
|
||||
handleMarkAsRead = () => {
|
||||
@@ -135,7 +137,7 @@ class Conversation extends ImmutablePureComponent {
|
||||
handleShowMore = () => {
|
||||
this.props.onToggleHidden(this.props.lastStatus);
|
||||
|
||||
if (this.props.lastStatus.get('spoiler_text')) {
|
||||
if (this.props.lastStatus.get("spoiler_text")) {
|
||||
this.setExpansion(!this.state.isExpanded);
|
||||
}
|
||||
};
|
||||
@@ -151,14 +153,14 @@ class Conversation extends ImmutablePureComponent {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isExpanded = this.props.settings.getIn(['content_warnings', 'shared_state']) ? !lastStatus.get('hidden') : this.state.isExpanded;
|
||||
const isExpanded = this.props.settings.getIn(["content_warnings", "shared_state"]) ? !lastStatus.get("hidden") : this.state.isExpanded;
|
||||
|
||||
const menu = [
|
||||
{ text: intl.formatMessage(messages.open), action: this.handleClick },
|
||||
null,
|
||||
];
|
||||
|
||||
menu.push({ text: intl.formatMessage(lastStatus.get('muted') ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMute });
|
||||
menu.push({ text: intl.formatMessage(lastStatus.get("muted") ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMute });
|
||||
|
||||
if (unread) {
|
||||
menu.push({ text: intl.formatMessage(messages.markAsRead), action: this.handleMarkAsRead });
|
||||
@@ -167,7 +169,7 @@ class Conversation extends ImmutablePureComponent {
|
||||
|
||||
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDelete });
|
||||
|
||||
const names = accounts.map(a => <Permalink to={`/@${a.get('acct')}`} href={a.get('url')} key={a.get('id')} title={a.get('acct')}><bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: a.get('display_name_html') }} /></bdi></Permalink>).reduce((prev, cur) => [prev, ', ', cur]);
|
||||
const names = accounts.map(a => <Permalink to={`/@${a.get("acct")}`} href={a.get("url")} key={a.get("id")} title={a.get("acct")}><bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: a.get("display_name_html") }} /></bdi></Permalink>).reduce((prev, cur) => [prev, ", ", cur]);
|
||||
|
||||
const handlers = {
|
||||
reply: this.handleReply,
|
||||
@@ -178,13 +180,13 @@ class Conversation extends ImmutablePureComponent {
|
||||
};
|
||||
|
||||
let media = null;
|
||||
if (lastStatus.get('media_attachments').size > 0) {
|
||||
media = <AttachmentList compact media={lastStatus.get('media_attachments')} />;
|
||||
if (lastStatus.get("media_attachments").size > 0) {
|
||||
media = <AttachmentList compact media={lastStatus.get("media_attachments")} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<HotKeys handlers={handlers}>
|
||||
<div className={classNames('conversation focusable muted', { 'conversation--unread': unread })} tabIndex={0}>
|
||||
<div className={classNames("conversation focusable muted", { "conversation--unread": unread })} tabIndex={0}>
|
||||
<div className='conversation__avatar' onClick={this.handleClick} role='presentation'>
|
||||
<AvatarComposite accounts={accounts} size={48} />
|
||||
</div>
|
||||
@@ -192,7 +194,7 @@ class Conversation extends ImmutablePureComponent {
|
||||
<div className='conversation__content'>
|
||||
<div className='conversation__content__info'>
|
||||
<div className='conversation__content__relative-time'>
|
||||
{unread && <span className='conversation__unread' />} <RelativeTimestamp timestamp={lastStatus.get('created_at')} />
|
||||
{unread && <span className='conversation__unread' />} <RelativeTimestamp timestamp={lastStatus.get("created_at")} />
|
||||
</div>
|
||||
|
||||
<div className='conversation__content__names' onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
|
||||
|
||||
+11
-11
@@ -1,13 +1,13 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import ImmutablePropTypes from "react-immutable-proptypes";
|
||||
import ImmutablePureComponent from "react-immutable-pure-component";
|
||||
|
||||
import { debounce } from 'lodash';
|
||||
import { debounce } from "lodash";
|
||||
|
||||
import ScrollableList from 'flavours/glitch/components/scrollable_list';
|
||||
import ScrollableList from "flavours/glitch/components/scrollable_list";
|
||||
|
||||
import ConversationContainer from '../containers/conversation_container';
|
||||
import ConversationContainer from "../containers/conversation_container";
|
||||
|
||||
export default class ConversationsList extends ImmutablePureComponent {
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class ConversationsList extends ImmutablePureComponent {
|
||||
onLoadMore: PropTypes.func,
|
||||
};
|
||||
|
||||
getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id);
|
||||
getCurrentIndex = id => this.props.conversations.findIndex(x => x.get("id") === id);
|
||||
|
||||
handleMoveUp = id => {
|
||||
const elementIndex = this.getCurrentIndex(id) - 1;
|
||||
@@ -52,8 +52,8 @@ export default class ConversationsList extends ImmutablePureComponent {
|
||||
handleLoadOlder = debounce(() => {
|
||||
const last = this.props.conversations.last();
|
||||
|
||||
if (last && last.get('last_status')) {
|
||||
this.props.onLoadMore(last.get('last_status'));
|
||||
if (last && last.get("last_status")) {
|
||||
this.props.onLoadMore(last.get("last_status"));
|
||||
}
|
||||
}, 300, { leading: true });
|
||||
|
||||
@@ -64,8 +64,8 @@ export default class ConversationsList extends ImmutablePureComponent {
|
||||
<ScrollableList {...other} isLoading={isLoading} showLoading={isLoading && conversations.isEmpty()} onLoadMore={onLoadMore && this.handleLoadOlder} ref={this.setRef}>
|
||||
{conversations.map(item => (
|
||||
<ConversationContainer
|
||||
key={item.get('id')}
|
||||
conversationId={item.get('id')}
|
||||
key={item.get("id")}
|
||||
conversationId={item.get("id")}
|
||||
onMoveUp={this.handleMoveUp}
|
||||
onMoveDown={this.handleMoveDown}
|
||||
scrollKey={this.props.scrollKey}
|
||||
|
||||
Reference in New Issue
Block a user