[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:
+3
-3
@@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { makeGetAccount } from '../../../selectors';
|
||||
import AutosuggestAccount from '../components/autosuggest_account';
|
||||
import { makeGetAccount } from "../../../selectors";
|
||||
import AutosuggestAccount from "../components/autosuggest_account";
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
const getAccount = makeGetAccount();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import {
|
||||
changeCompose,
|
||||
@@ -9,25 +9,25 @@ import {
|
||||
changeComposeSpoilerText,
|
||||
insertEmojiCompose,
|
||||
uploadCompose,
|
||||
} from '../../../actions/compose';
|
||||
import ComposeForm from '../components/compose_form';
|
||||
} from "../../../actions/compose";
|
||||
import ComposeForm from "../components/compose_form";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
text: state.getIn(['compose', 'text']),
|
||||
suggestions: state.getIn(['compose', 'suggestions']),
|
||||
spoiler: state.getIn(['compose', 'spoiler']),
|
||||
spoilerText: state.getIn(['compose', 'spoiler_text']),
|
||||
privacy: state.getIn(['compose', 'privacy']),
|
||||
focusDate: state.getIn(['compose', 'focusDate']),
|
||||
caretPosition: state.getIn(['compose', 'caretPosition']),
|
||||
preselectDate: state.getIn(['compose', 'preselectDate']),
|
||||
isSubmitting: state.getIn(['compose', 'is_submitting']),
|
||||
isEditing: state.getIn(['compose', 'id']) !== null,
|
||||
isChangingUpload: state.getIn(['compose', 'is_changing_upload']),
|
||||
isUploading: state.getIn(['compose', 'is_uploading']),
|
||||
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
|
||||
isInReply: state.getIn(['compose', 'in_reply_to']) !== null,
|
||||
lang: state.getIn(['compose', 'language']),
|
||||
text: state.getIn(["compose", "text"]),
|
||||
suggestions: state.getIn(["compose", "suggestions"]),
|
||||
spoiler: state.getIn(["compose", "spoiler"]),
|
||||
spoilerText: state.getIn(["compose", "spoiler_text"]),
|
||||
privacy: state.getIn(["compose", "privacy"]),
|
||||
focusDate: state.getIn(["compose", "focusDate"]),
|
||||
caretPosition: state.getIn(["compose", "caretPosition"]),
|
||||
preselectDate: state.getIn(["compose", "preselectDate"]),
|
||||
isSubmitting: state.getIn(["compose", "is_submitting"]),
|
||||
isEditing: state.getIn(["compose", "id"]) !== null,
|
||||
isChangingUpload: state.getIn(["compose", "is_changing_upload"]),
|
||||
isUploading: state.getIn(["compose", "is_uploading"]),
|
||||
anyMedia: state.getIn(["compose", "media_attachments"]).size > 0,
|
||||
isInReply: state.getIn(["compose", "in_reply_to"]) !== null,
|
||||
lang: state.getIn(["compose", "language"]),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
+30
-30
@@ -1,35 +1,35 @@
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Map as ImmutableMap } from "immutable";
|
||||
import { connect } from "react-redux";
|
||||
import { createSelector } from "reselect";
|
||||
|
||||
import { useEmoji } from '../../../actions/emojis';
|
||||
import { changeSetting } from '../../../actions/settings';
|
||||
import EmojiPickerDropdown from '../components/emoji_picker_dropdown';
|
||||
import { useEmoji } from "../../../actions/emojis";
|
||||
import { changeSetting } from "../../../actions/settings";
|
||||
import EmojiPickerDropdown from "../components/emoji_picker_dropdown";
|
||||
|
||||
const perLine = 8;
|
||||
const lines = 2;
|
||||
|
||||
const DEFAULTS = [
|
||||
'+1',
|
||||
'grinning',
|
||||
'kissing_heart',
|
||||
'heart_eyes',
|
||||
'laughing',
|
||||
'stuck_out_tongue_winking_eye',
|
||||
'sweat_smile',
|
||||
'joy',
|
||||
'yum',
|
||||
'disappointed',
|
||||
'thinking_face',
|
||||
'weary',
|
||||
'sob',
|
||||
'sunglasses',
|
||||
'heart',
|
||||
'ok_hand',
|
||||
"+1",
|
||||
"grinning",
|
||||
"kissing_heart",
|
||||
"heart_eyes",
|
||||
"laughing",
|
||||
"stuck_out_tongue_winking_eye",
|
||||
"sweat_smile",
|
||||
"joy",
|
||||
"yum",
|
||||
"disappointed",
|
||||
"thinking_face",
|
||||
"weary",
|
||||
"sob",
|
||||
"sunglasses",
|
||||
"heart",
|
||||
"ok_hand",
|
||||
];
|
||||
|
||||
const getFrequentlyUsedEmojis = createSelector([
|
||||
state => state.getIn(['settings', 'frequentlyUsedEmojis'], ImmutableMap()),
|
||||
state => state.getIn(["settings", "frequentlyUsedEmojis"], ImmutableMap()),
|
||||
], emojiCounters => {
|
||||
let emojis = emojiCounters
|
||||
.keySeq()
|
||||
@@ -47,10 +47,10 @@ const getFrequentlyUsedEmojis = createSelector([
|
||||
});
|
||||
|
||||
const getCustomEmojis = createSelector([
|
||||
state => state.get('custom_emojis'),
|
||||
], emojis => emojis.filter(e => e.get('visible_in_picker')).sort((a, b) => {
|
||||
const aShort = a.get('shortcode').toLowerCase();
|
||||
const bShort = b.get('shortcode').toLowerCase();
|
||||
state => state.get("custom_emojis"),
|
||||
], emojis => emojis.filter(e => e.get("visible_in_picker")).sort((a, b) => {
|
||||
const aShort = a.get("shortcode").toLowerCase();
|
||||
const bShort = b.get("shortcode").toLowerCase();
|
||||
|
||||
if (aShort < bShort) {
|
||||
return -1;
|
||||
@@ -63,17 +63,17 @@ const getCustomEmojis = createSelector([
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
custom_emojis: getCustomEmojis(state),
|
||||
skinTone: state.getIn(['settings', 'skinTone']),
|
||||
skinTone: state.getIn(["settings", "skinTone"]),
|
||||
frequentlyUsedEmojis: getFrequentlyUsedEmojis(state),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch, { onPickEmoji }) => ({
|
||||
onSkinTone: skinTone => {
|
||||
dispatch(changeSetting(['skinTone'], skinTone));
|
||||
dispatch(changeSetting(["skinTone"], skinTone));
|
||||
},
|
||||
|
||||
onPickEmoji: emoji => {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
dispatch(useEmoji(emoji));
|
||||
|
||||
if (onPickEmoji) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Map as ImmutableMap } from "immutable";
|
||||
import { connect } from "react-redux";
|
||||
import { createSelector } from "reselect";
|
||||
|
||||
import { changeComposeLanguage } from 'mastodon/actions/compose';
|
||||
import { useLanguage } from 'mastodon/actions/languages';
|
||||
import { changeComposeLanguage } from "mastodon/actions/compose";
|
||||
import { useLanguage } from "mastodon/actions/languages";
|
||||
|
||||
import LanguageDropdown from '../components/language_dropdown';
|
||||
import LanguageDropdown from "../components/language_dropdown";
|
||||
|
||||
const getFrequentlyUsedLanguages = createSelector([
|
||||
state => state.getIn(['settings', 'frequentlyUsedLanguages'], ImmutableMap()),
|
||||
state => state.getIn(["settings", "frequentlyUsedLanguages"], ImmutableMap()),
|
||||
], languageCounters => (
|
||||
languageCounters.keySeq()
|
||||
.sort((a, b) => languageCounters.get(a) - languageCounters.get(b))
|
||||
@@ -18,7 +18,7 @@ const getFrequentlyUsedLanguages = createSelector([
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
frequentlyUsedLanguages: getFrequentlyUsedLanguages(state),
|
||||
value: state.getIn(['compose', 'language']),
|
||||
value: state.getIn(["compose", "language"]),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
@@ -28,7 +28,7 @@ const mapDispatchToProps = dispatch => ({
|
||||
},
|
||||
|
||||
onClose (value) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
dispatch(useLanguage(value));
|
||||
},
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import { defineMessages, injectIntl } from "react-intl";
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { openModal } from 'mastodon/actions/modal';
|
||||
import { logOut } from 'mastodon/utils/log_out';
|
||||
import { openModal } from "mastodon/actions/modal";
|
||||
import { logOut } from "mastodon/utils/log_out";
|
||||
|
||||
import { me } from '../../../initial_state';
|
||||
import NavigationBar from '../components/navigation_bar';
|
||||
import { me } from "../../../initial_state";
|
||||
import NavigationBar from "../components/navigation_bar";
|
||||
|
||||
const messages = defineMessages({
|
||||
logoutMessage: { id: 'confirmations.logout.message', defaultMessage: 'Are you sure you want to log out?' },
|
||||
logoutConfirm: { id: 'confirmations.logout.confirm', defaultMessage: 'Log out' },
|
||||
logoutMessage: { id: "confirmations.logout.message", defaultMessage: "Are you sure you want to log out?" },
|
||||
logoutConfirm: { id: "confirmations.logout.confirm", defaultMessage: "Log out" },
|
||||
});
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
account: state.getIn(['accounts', me]),
|
||||
account: state.getIn(["accounts", me]),
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
onLogout () {
|
||||
dispatch(openModal({
|
||||
modalType: 'CONFIRM',
|
||||
modalType: "CONFIRM",
|
||||
modalProps: {
|
||||
message: intl.formatMessage(messages.logoutMessage),
|
||||
confirm: intl.formatMessage(messages.logoutConfirm),
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { addPoll, removePoll } from '../../../actions/compose';
|
||||
import PollButton from '../components/poll_button';
|
||||
import { addPoll, removePoll } from "../../../actions/compose";
|
||||
import PollButton from "../components/poll_button";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
unavailable: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size > 0),
|
||||
active: state.getIn(['compose', 'poll']) !== null,
|
||||
unavailable: state.getIn(["compose", "is_uploading"]) || (state.getIn(["compose", "media_attachments"]).size > 0),
|
||||
active: state.getIn(["compose", "poll"]) !== null,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onClick () {
|
||||
dispatch((_, getState) => {
|
||||
if (getState().getIn(['compose', 'poll'])) {
|
||||
if (getState().getIn(["compose", "poll"])) {
|
||||
dispatch(removePoll());
|
||||
} else {
|
||||
dispatch(addPoll());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import {
|
||||
addPollOption,
|
||||
@@ -8,15 +8,15 @@ import {
|
||||
clearComposeSuggestions,
|
||||
fetchComposeSuggestions,
|
||||
selectComposeSuggestion,
|
||||
} from '../../../actions/compose';
|
||||
import PollForm from '../components/poll_form';
|
||||
} from "../../../actions/compose";
|
||||
import PollForm from "../components/poll_form";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
suggestions: state.getIn(['compose', 'suggestions']),
|
||||
options: state.getIn(['compose', 'poll', 'options']),
|
||||
lang: state.getIn(['compose', 'language']),
|
||||
expiresIn: state.getIn(['compose', 'poll', 'expires_in']),
|
||||
isMultiple: state.getIn(['compose', 'poll', 'multiple']),
|
||||
suggestions: state.getIn(["compose", "suggestions"]),
|
||||
options: state.getIn(["compose", "poll", "options"]),
|
||||
lang: state.getIn(["compose", "language"]),
|
||||
expiresIn: state.getIn(["compose", "poll", "expires_in"]),
|
||||
isMultiple: state.getIn(["compose", "poll", "multiple"]),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { changeComposeVisibility } from '../../../actions/compose';
|
||||
import { openModal, closeModal } from '../../../actions/modal';
|
||||
import { isUserTouching } from '../../../is_mobile';
|
||||
import PrivacyDropdown from '../components/privacy_dropdown';
|
||||
import { changeComposeVisibility } from "../../../actions/compose";
|
||||
import { openModal, closeModal } from "../../../actions/modal";
|
||||
import { isUserTouching } from "../../../is_mobile";
|
||||
import PrivacyDropdown from "../components/privacy_dropdown";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
value: state.getIn(['compose', 'privacy']),
|
||||
value: state.getIn(["compose", "privacy"]),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
@@ -17,7 +17,7 @@ const mapDispatchToProps = dispatch => ({
|
||||
|
||||
isUserTouching,
|
||||
onModalOpen: props => dispatch(openModal({
|
||||
modalType: 'ACTIONS',
|
||||
modalType: "ACTIONS",
|
||||
modalProps: props,
|
||||
})),
|
||||
onModalClose: () => dispatch(closeModal({
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { cancelReplyCompose } from '../../../actions/compose';
|
||||
import { makeGetStatus } from '../../../selectors';
|
||||
import ReplyIndicator from '../components/reply_indicator';
|
||||
import { cancelReplyCompose } from "../../../actions/compose";
|
||||
import { makeGetStatus } from "../../../selectors";
|
||||
import ReplyIndicator from "../components/reply_indicator";
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
const getStatus = makeGetStatus();
|
||||
|
||||
const mapStateToProps = state => {
|
||||
let statusId = state.getIn(['compose', 'id'], null);
|
||||
let statusId = state.getIn(["compose", "id"], null);
|
||||
let editing = true;
|
||||
|
||||
if (statusId === null) {
|
||||
statusId = state.getIn(['compose', 'in_reply_to']);
|
||||
statusId = state.getIn(["compose", "in_reply_to"]);
|
||||
editing = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import {
|
||||
changeSearch,
|
||||
@@ -8,14 +8,14 @@ import {
|
||||
openURL,
|
||||
clickSearchResult,
|
||||
forgetSearchResult,
|
||||
} from 'mastodon/actions/search';
|
||||
} from "mastodon/actions/search";
|
||||
|
||||
import Search from '../components/search';
|
||||
import Search from "../components/search";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
value: state.getIn(['search', 'value']),
|
||||
submitted: state.getIn(['search', 'submitted']),
|
||||
recent: state.getIn(['search', 'recent']).reverse(),
|
||||
value: state.getIn(["search", "value"]),
|
||||
submitted: state.getIn(["search", "submitted"]),
|
||||
recent: state.getIn(["search", "recent"]).reverse(),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { expandSearch } from 'mastodon/actions/search';
|
||||
import { fetchSuggestions, dismissSuggestion } from 'mastodon/actions/suggestions';
|
||||
import { expandSearch } from "mastodon/actions/search";
|
||||
import { fetchSuggestions, dismissSuggestion } from "mastodon/actions/suggestions";
|
||||
|
||||
import SearchResults from '../components/search_results';
|
||||
import SearchResults from "../components/search_results";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
results: state.getIn(['search', 'results']),
|
||||
suggestions: state.getIn(['suggestions', 'items']),
|
||||
searchTerm: state.getIn(['search', 'searchTerm']),
|
||||
results: state.getIn(["search", "results"]),
|
||||
suggestions: state.getIn(["suggestions", "items"]),
|
||||
searchTerm: state.getIn(["search", "searchTerm"]),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
fetchSuggestions: () => dispatch(fetchSuggestions()),
|
||||
expandSearch: type => dispatch(expandSearch(type)),
|
||||
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
|
||||
dismissSuggestion: account => dispatch(dismissSuggestion(account.get("id"))),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(SearchResults);
|
||||
|
||||
+14
-14
@@ -1,29 +1,29 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { PureComponent } from 'react';
|
||||
import PropTypes from "prop-types";
|
||||
import { PureComponent } from "react";
|
||||
|
||||
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
|
||||
import { injectIntl, defineMessages, FormattedMessage } from "react-intl";
|
||||
|
||||
import classNames from 'classnames';
|
||||
import classNames from "classnames";
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { changeComposeSensitivity } from 'mastodon/actions/compose';
|
||||
import { changeComposeSensitivity } from "mastodon/actions/compose";
|
||||
|
||||
const messages = defineMessages({
|
||||
marked: {
|
||||
id: 'compose_form.sensitive.marked',
|
||||
defaultMessage: '{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}',
|
||||
id: "compose_form.sensitive.marked",
|
||||
defaultMessage: "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||
},
|
||||
unmarked: {
|
||||
id: 'compose_form.sensitive.unmarked',
|
||||
defaultMessage: '{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}',
|
||||
id: "compose_form.sensitive.unmarked",
|
||||
defaultMessage: "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||
},
|
||||
});
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
active: state.getIn(['compose', 'sensitive']),
|
||||
disabled: state.getIn(['compose', 'spoiler']),
|
||||
mediaCount: state.getIn(['compose', 'media_attachments']).size,
|
||||
active: state.getIn(["compose", "sensitive"]),
|
||||
disabled: state.getIn(["compose", "spoiler"]),
|
||||
mediaCount: state.getIn(["compose", "media_attachments"]).size,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
@@ -49,7 +49,7 @@ class SensitiveButton extends PureComponent {
|
||||
|
||||
return (
|
||||
<div className='compose-form__sensitive-button'>
|
||||
<label className={classNames('icon-button', { active })} title={intl.formatMessage(active ? messages.marked : messages.unmarked, { count: mediaCount })}>
|
||||
<label className={classNames("icon-button", { active })} title={intl.formatMessage(active ? messages.marked : messages.unmarked, { count: mediaCount })}>
|
||||
<input
|
||||
name='mark-sensitive'
|
||||
type='checkbox'
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { injectIntl, defineMessages } from 'react-intl';
|
||||
import { injectIntl, defineMessages } from "react-intl";
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { changeComposeSpoilerness } from '../../../actions/compose';
|
||||
import TextIconButton from '../components/text_icon_button';
|
||||
import { changeComposeSpoilerness } from "../../../actions/compose";
|
||||
import TextIconButton from "../components/text_icon_button";
|
||||
|
||||
const messages = defineMessages({
|
||||
marked: { id: 'compose_form.spoiler.marked', defaultMessage: 'Text is hidden behind warning' },
|
||||
unmarked: { id: 'compose_form.spoiler.unmarked', defaultMessage: 'Text is not hidden' },
|
||||
marked: { id: "compose_form.spoiler.marked", defaultMessage: "Text is hidden behind warning" },
|
||||
unmarked: { id: "compose_form.spoiler.unmarked", defaultMessage: "Text is not hidden" },
|
||||
});
|
||||
|
||||
const mapStateToProps = (state, { intl }) => ({
|
||||
label: 'CW',
|
||||
title: intl.formatMessage(state.getIn(['compose', 'spoiler']) ? messages.marked : messages.unmarked),
|
||||
active: state.getIn(['compose', 'spoiler']),
|
||||
ariaControls: 'cw-spoiler-input',
|
||||
label: "CW",
|
||||
title: intl.formatMessage(state.getIn(["compose", "spoiler"]) ? messages.marked : messages.unmarked),
|
||||
active: state.getIn(["compose", "spoiler"]),
|
||||
ariaControls: "cw-spoiler-input",
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { uploadCompose } from '../../../actions/compose';
|
||||
import UploadButton from '../components/upload_button';
|
||||
import { uploadCompose } from "../../../actions/compose";
|
||||
import UploadButton from "../components/upload_button";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
disabled: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size + state.getIn(['compose', 'pending_media_attachments']) > 3 || state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type')))),
|
||||
unavailable: state.getIn(['compose', 'poll']) !== null,
|
||||
resetFileKey: state.getIn(['compose', 'resetFileKey']),
|
||||
disabled: state.getIn(["compose", "is_uploading"]) || (state.getIn(["compose", "media_attachments"]).size + state.getIn(["compose", "pending_media_attachments"]) > 3 || state.getIn(["compose", "media_attachments"]).some(m => ["video", "audio"].includes(m.get("type")))),
|
||||
unavailable: state.getIn(["compose", "poll"]) !== null,
|
||||
resetFileKey: state.getIn(["compose", "resetFileKey"]),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { undoUploadCompose, initMediaEditModal, submitCompose } from '../../../actions/compose';
|
||||
import Upload from '../components/upload';
|
||||
import { undoUploadCompose, initMediaEditModal, submitCompose } from "../../../actions/compose";
|
||||
import Upload from "../components/upload";
|
||||
|
||||
const mapStateToProps = (state, { id }) => ({
|
||||
media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
|
||||
media: state.getIn(["compose", "media_attachments"]).find(item => item.get("id") === id),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import UploadForm from '../components/upload_form';
|
||||
import UploadForm from "../components/upload_form";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
mediaIds: state.getIn(['compose', 'media_attachments']).map(item => item.get('id')),
|
||||
mediaIds: state.getIn(["compose", "media_attachments"]).map(item => item.get("id")),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(UploadForm);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import UploadProgress from '../components/upload_progress';
|
||||
import UploadProgress from "../components/upload_progress";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
active: state.getIn(['compose', 'is_uploading']),
|
||||
progress: state.getIn(['compose', 'progress']),
|
||||
isProcessing: state.getIn(['compose', 'is_processing']),
|
||||
active: state.getIn(["compose", "is_uploading"]),
|
||||
progress: state.getIn(["compose", "progress"]),
|
||||
isProcessing: state.getIn(["compose", "is_processing"]),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(UploadProgress);
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { FormattedMessage } from "react-intl";
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { me } from 'mastodon/initial_state';
|
||||
import { HASHTAG_PATTERN_REGEX } from 'mastodon/utils/hashtags';
|
||||
import { me } from "mastodon/initial_state";
|
||||
import { HASHTAG_PATTERN_REGEX } from "mastodon/utils/hashtags";
|
||||
|
||||
import Warning from '../components/warning';
|
||||
import Warning from "../components/warning";
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']),
|
||||
hashtagWarning: state.getIn(['compose', 'privacy']) !== 'public' && HASHTAG_PATTERN_REGEX.test(state.getIn(['compose', 'text'])),
|
||||
directMessageWarning: state.getIn(['compose', 'privacy']) === 'direct',
|
||||
needsLockWarning: state.getIn(["compose", "privacy"]) === "private" && !state.getIn(["accounts", me, "locked"]),
|
||||
hashtagWarning: state.getIn(["compose", "privacy"]) !== "public" && HASHTAG_PATTERN_REGEX.test(state.getIn(["compose", "text"])),
|
||||
directMessageWarning: state.getIn(["compose", "privacy"]) === "direct",
|
||||
});
|
||||
|
||||
const WarningWrapper = ({ needsLockWarning, hashtagWarning, directMessageWarning }) => {
|
||||
|
||||
Reference in New Issue
Block a user