]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/favourites/index.js
1 import React
from 'react' ;
2 import { connect
} from 'react-redux' ;
3 import ImmutablePureComponent
from 'react-immutable-pure-component' ;
4 import PropTypes
from 'prop-types' ;
5 import ImmutablePropTypes
from 'react-immutable-proptypes' ;
6 import LoadingIndicator
from '../../components/loading_indicator' ;
7 import { fetchFavourites
} from '../../actions/interactions' ;
8 import { FormattedMessage
} from 'react-intl' ;
9 import AccountContainer
from '../../containers/account_container' ;
10 import Column
from '../ui/components/column' ;
11 import ColumnBackButton
from '../../components/column_back_button' ;
12 import ScrollableList
from '../../components/scrollable_list' ;
14 const mapStateToProps
= ( state
, props
) => ({
15 accountIds : state
. getIn ([ 'user_lists' , 'favourited_by' , props
. params
. statusId
]),
18 @ connect ( mapStateToProps
)
19 export default class Favourites
extends ImmutablePureComponent
{
22 params : PropTypes
. object
. isRequired
,
23 dispatch : PropTypes
. func
. isRequired
,
24 shouldUpdateScroll : PropTypes
. func
,
25 accountIds : ImmutablePropTypes
. list
,
28 componentWillMount () {
29 this . props
. dispatch ( fetchFavourites ( this . props
. params
. statusId
));
32 componentWillReceiveProps ( nextProps
) {
33 if ( nextProps
. params
. statusId
!== this . props
. params
. statusId
&& nextProps
. params
. statusId
) {
34 this . props
. dispatch ( fetchFavourites ( nextProps
. params
. statusId
));
39 const { shouldUpdateScroll
, accountIds
} = this . props
;
49 const emptyMessage
= < FormattedMessage id
= 'empty_column.favourites' defaultMessage
= 'No one has favourited this toot yet. When someone does, they will show up here.' />;
56 scrollKey
= 'favourites'
57 shouldUpdateScroll
={ shouldUpdateScroll
}
58 emptyMessage
={ emptyMessage
}
61 < AccountContainer key
={ id
} id
={ id
} withNote
={ false } />
This page took 0.343656 seconds and 5 git commands to generate.