This commit is contained in:
mgabdev
2020-04-11 18:29:19 -04:00
parent 7249143d9f
commit 595208780e
160 changed files with 1678 additions and 2103 deletions

View File

@@ -11,15 +11,13 @@ const messages = defineMessages({
show_all: { id: 'groups.sidebar-panel.show_all', defaultMessage: 'Show all' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
hashtags: state.getIn(['hashtags', 'items']),
})
const mapDispatchToProps = dispatch => {
return {
fetchHashtags: () => dispatch(fetchHashtags()),
}
}
const mapDispatchToProps = (dispatch) => ({
fetchHashtags: () => dispatch(fetchHashtags()),
})
export default
@connect(mapStateToProps, mapDispatchToProps)

View File

@@ -17,15 +17,13 @@ const messages = defineMessages({
edit: { id: 'edit', defaultMessage: 'Edit' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
// accountIds: state.getIn(['listEditor', 'accounts', 'items']),
})
const mapDispatchToProps = dispatch => {
return {
const mapDispatchToProps = (dispatch) => ({
}
}
})
export default
@connect(mapStateToProps, mapDispatchToProps)
@@ -96,7 +94,7 @@ class ListDetailsPanel extends ImmutablePureComponent {
{
[1, 2, 3, 4, 5, 6, 7, 8, 9].map(item => (
<div className={[_s.default, _s.mr5].join(' ')}>
<Avatar size='26' />
<Avatar size={26} />
</div>
))
}

View File

@@ -36,7 +36,7 @@ class MediaGalleryPanel extends ImmutablePureComponent {
componentDidMount() {
const { accountId } = this.props
if (accountId) {
if (accountId && accountId !== -1) {
this.props.dispatch(expandAccountMediaTimeline(accountId, { limit: 8 }))
}
}

View File

@@ -1,6 +1,7 @@
import { defineMessages, injectIntl } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
import ImmutablePropTypes from 'react-immutable-proptypes'
import { me } from '../../initial_state'
import { setFilter } from '../../actions/notifications'
import PanelLayout from './panel_layout'
import SettingSwitch from '../setting_switch'
@@ -11,17 +12,16 @@ const messages = defineMessages({
onlyFollowing: { id: 'notification_only_following', defaultMessage: 'Only People I Follow' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
settings: state.getIn(['notifications', 'filter']),
isPro: state.getIn(['accounts', me, 'is_pro']),
})
const mapDispatchToProps = (dispatch) => {
return {
onChange(path, value) {
dispatch(setFilter(path, value))
},
}
}
const mapDispatchToProps = (dispatch) => ({
onChange(path, value) {
dispatch(setFilter(path, value))
},
})
export default
@injectIntl
@@ -32,10 +32,18 @@ class NotificationFilterPanel extends ImmutablePureComponent {
intl: PropTypes.object.isRequired,
onChange: PropTypes.func.isRequired,
settings: ImmutablePropTypes.map.isRequired,
isPro: PropTypes.bool.isRequired,
}
render() {
const { intl, onChange, settings } = this.props
const {
intl,
onChange,
settings,
isPro
} = this.props
if (!isPro) return null
return (
<PanelLayout title={intl.formatMessage(messages.title)}>

View File

@@ -25,12 +25,10 @@ const mapStateToProps = (state, { account }) => {
}
}
const mapDispatchToProps = dispatch => {
return {
fetchSuggestions: () => dispatch(fetchSuggestions()),
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
}
}
const mapDispatchToProps = (dispatch) => ({
fetchSuggestions: () => dispatch(fetchSuggestions()),
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
})
export default
@connect(mapStateToProps, mapDispatchToProps)

View File

@@ -10,15 +10,13 @@ const messages = defineMessages({
title: { id: 'trends.title', defaultMessage: 'Trending right now' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
gabtrends: state.getIn(['gab_trends', 'items']),
})
const mapDispatchToProps = dispatch => {
return {
onFetchGabTrends: () => dispatch(fetchGabTrends()),
}
}
const mapDispatchToProps = (dispatch) => ({
onFetchGabTrends: () => dispatch(fetchGabTrends()),
})
export default
@connect(mapStateToProps, mapDispatchToProps)

View File

@@ -22,11 +22,9 @@ const messages = defineMessages({
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
})
const mapStateToProps = state => {
return {
account: makeGetAccount()(state, me),
}
}
const mapStateToProps = (state) => ({
account: makeGetAccount()(state, me),
})
export default
@connect(mapStateToProps)
@@ -72,7 +70,7 @@ class UserPanel extends ImmutablePureComponent {
<Image
className={_s.height122PX}
src={account.get('header_static')}
/>
/>
<Button
color='secondary'
backgroundColor='secondary'

View File

@@ -2,7 +2,7 @@ import { defineMessages, injectIntl } from 'react-intl';
import { fetchSuggestions, dismissSuggestion } from '../../actions/suggestions';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import AccountContainer from '../../containers/account_container';
import Account from '../../components/account';
import PanelLayout from './panel_layout';
const messages = defineMessages({
@@ -11,16 +11,14 @@ const messages = defineMessages({
show_more: { id: 'who_to_follow.more', defaultMessage: 'Show more' },
});
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
suggestions: state.getIn(['suggestions', 'items']),
});
const mapDispatchToProps = dispatch => {
return {
fetchSuggestions: () => dispatch(fetchSuggestions()),
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
}
};
const mapDispatchToProps = (dispatch) => ({
fetchSuggestions: () => dispatch(fetchSuggestions()),
dismissSuggestion: (account) => dispatch(dismissSuggestion(account.get('id'))),
})
export default
@connect(mapStateToProps, mapDispatchToProps)
@@ -56,7 +54,7 @@ class WhoToFollowPanel extends ImmutablePureComponent {
>
<div className={_s.default}>
{suggestions && suggestions.map(accountId => (
<AccountContainer
<Account
showDismiss
key={accountId}
id={accountId}