This commit is contained in:
mgabdev
2020-02-19 18:57:07 -05:00
parent be3daea78b
commit e37500c0cf
105 changed files with 1975 additions and 1393 deletions

View File

@@ -1,49 +1,50 @@
import { injectIntl, defineMessages } from 'react-intl';
import { fetchTrends } from '../../actions/trends';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import TrendingItem from '../../components/trending_item';
import PanelLayout from './panel_layout';
import { injectIntl, defineMessages } from 'react-intl'
// import { fetchTrends } from '../../actions/trends'
import ImmutablePureComponent from 'react-immutable-pure-component'
import ImmutablePropTypes from 'react-immutable-proptypes'
import TrendingItem from '../../components/trending_item'
import PanelLayout from './panel_layout'
const messages = defineMessages({
title: { id:'trends.title', defaultMessage: 'Trends for you' },
});
title: { id:'trends.title', defaultMessage: 'Trending right now' },
})
const mapStateToProps = state => ({
trends: state.getIn(['trends', 'items']),
});
// const mapStateToProps = state => ({
// trends: state.getIn(['trends', 'items']),
// })
const mapDispatchToProps = dispatch => {
return {
fetchTrends: () => dispatch(fetchTrends()),
}
};
// const mapDispatchToProps = dispatch => {
// return {
// fetchTrends: () => dispatch(fetchTrends()),
// }
// }
export default @connect(mapStateToProps, mapDispatchToProps)
export default
// @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
class TrendsPanel extends ImmutablePureComponent {
static propTypes = {
trends: ImmutablePropTypes.list.isRequired,
fetchTrends: PropTypes.func.isRequired,
// fetchTrends: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
}
componentDidMount () {
this.props.fetchTrends();
// this.props.fetchTrends()
}
render() {
const { intl, trends } = this.props;
const { intl, trends } = this.props
// !!! TESTING !!!
// if (trends.isEmpty()) {
// return null;
// return null
// }
return (
<PanelLayout title={intl.formatMessage(messages.title)}>
<div className={styles.default}>
<div className={_s.default}>
{ /* trends && trends.map(hashtag => (
<TrendingItem key={hashtag.get('name')} hashtag={hashtag} />
)) */ }
@@ -54,6 +55,6 @@ class TrendsPanel extends ImmutablePureComponent {
<TrendingItem />
</div>
</PanelLayout>
);
)
}
};
}