From 81ef21a0c802f1d905f37a2a818544a8b400793c Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Sat, 25 Feb 2023 14:34:32 +0100 Subject: [Glitch] Rename JSX files with proper `.jsx` extension Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire --- .../features/pinned_accounts_editor/index.js | 78 ---------------------- .../features/pinned_accounts_editor/index.jsx | 78 ++++++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 app/javascript/flavours/glitch/features/pinned_accounts_editor/index.js create mode 100644 app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx (limited to 'app/javascript/flavours/glitch/features/pinned_accounts_editor') diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.js b/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.js deleted file mode 100644 index 43ae0ec2f..000000000 --- a/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.js +++ /dev/null @@ -1,78 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import { connect } from 'react-redux'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { injectIntl, FormattedMessage } from 'react-intl'; -import { fetchPinnedAccounts, clearPinnedAccountsSuggestions, resetPinnedAccountsEditor } from 'flavours/glitch/actions/accounts'; -import AccountContainer from './containers/account_container'; -import SearchContainer from './containers/search_container'; -import Motion from 'flavours/glitch/features/ui/util/optional_motion'; -import spring from 'react-motion/lib/spring'; - -const mapStateToProps = state => ({ - accountIds: state.getIn(['pinnedAccountsEditor', 'accounts', 'items']), - searchAccountIds: state.getIn(['pinnedAccountsEditor', 'suggestions', 'items']), -}); - -const mapDispatchToProps = dispatch => ({ - onInitialize: () => dispatch(fetchPinnedAccounts()), - onClear: () => dispatch(clearPinnedAccountsSuggestions()), - onReset: () => dispatch(resetPinnedAccountsEditor()), -}); - -export default @connect(mapStateToProps, mapDispatchToProps) -@injectIntl -class PinnedAccountsEditor extends ImmutablePureComponent { - - static propTypes = { - onClose: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - onInitialize: PropTypes.func.isRequired, - onClear: PropTypes.func.isRequired, - onReset: PropTypes.func.isRequired, - title: PropTypes.string.isRequired, - accountIds: ImmutablePropTypes.list.isRequired, - searchAccountIds: ImmutablePropTypes.list.isRequired, - }; - - componentDidMount () { - const { onInitialize } = this.props; - onInitialize(); - } - - componentWillUnmount () { - const { onReset } = this.props; - onReset(); - } - - render () { - const { accountIds, searchAccountIds, onClear } = this.props; - const showSearch = searchAccountIds.size > 0; - - return ( -
-

- - - -
-
- {accountIds.map(accountId => )} -
- - {showSearch &&
} - - - {({ x }) => - (
- {searchAccountIds.map(accountId => )} -
) - } -
-
-
- ); - } - -} diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx b/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx new file mode 100644 index 000000000..43ae0ec2f --- /dev/null +++ b/app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx @@ -0,0 +1,78 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import { connect } from 'react-redux'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { injectIntl, FormattedMessage } from 'react-intl'; +import { fetchPinnedAccounts, clearPinnedAccountsSuggestions, resetPinnedAccountsEditor } from 'flavours/glitch/actions/accounts'; +import AccountContainer from './containers/account_container'; +import SearchContainer from './containers/search_container'; +import Motion from 'flavours/glitch/features/ui/util/optional_motion'; +import spring from 'react-motion/lib/spring'; + +const mapStateToProps = state => ({ + accountIds: state.getIn(['pinnedAccountsEditor', 'accounts', 'items']), + searchAccountIds: state.getIn(['pinnedAccountsEditor', 'suggestions', 'items']), +}); + +const mapDispatchToProps = dispatch => ({ + onInitialize: () => dispatch(fetchPinnedAccounts()), + onClear: () => dispatch(clearPinnedAccountsSuggestions()), + onReset: () => dispatch(resetPinnedAccountsEditor()), +}); + +export default @connect(mapStateToProps, mapDispatchToProps) +@injectIntl +class PinnedAccountsEditor extends ImmutablePureComponent { + + static propTypes = { + onClose: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + onInitialize: PropTypes.func.isRequired, + onClear: PropTypes.func.isRequired, + onReset: PropTypes.func.isRequired, + title: PropTypes.string.isRequired, + accountIds: ImmutablePropTypes.list.isRequired, + searchAccountIds: ImmutablePropTypes.list.isRequired, + }; + + componentDidMount () { + const { onInitialize } = this.props; + onInitialize(); + } + + componentWillUnmount () { + const { onReset } = this.props; + onReset(); + } + + render () { + const { accountIds, searchAccountIds, onClear } = this.props; + const showSearch = searchAccountIds.size > 0; + + return ( +
+

+ + + +
+
+ {accountIds.map(accountId => )} +
+ + {showSearch &&
} + + + {({ x }) => + (
+ {searchAccountIds.map(accountId => )} +
) + } +
+
+
+ ); + } + +} -- cgit