2020-02-19 23:57:07 +00:00
|
|
|
import { injectIntl, defineMessages } from 'react-intl'
|
|
|
|
// import { fetchTrends } from '../../actions/trends'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
2020-02-21 00:57:29 +00:00
|
|
|
import TrendingItem from '../trends_panel_item'
|
2020-02-19 23:57:07 +00:00
|
|
|
import PanelLayout from './panel_layout'
|
2019-08-07 06:02:36 +01:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
2020-02-19 23:57:07 +00:00
|
|
|
title: { id:'trends.title', defaultMessage: 'Trending right now' },
|
2020-02-21 00:57:29 +00:00
|
|
|
show_all: { id: 'groups.sidebar-panel.show_all', defaultMessage: 'Show all' },
|
2020-02-19 23:57:07 +00:00
|
|
|
})
|
2019-08-07 06:02:36 +01:00
|
|
|
|
2020-02-19 23:57:07 +00:00
|
|
|
// const mapStateToProps = state => ({
|
|
|
|
// trends: state.getIn(['trends', 'items']),
|
|
|
|
// })
|
2019-08-07 06:02:36 +01:00
|
|
|
|
2020-02-19 23:57:07 +00:00
|
|
|
// const mapDispatchToProps = dispatch => {
|
|
|
|
// return {
|
|
|
|
// fetchTrends: () => dispatch(fetchTrends()),
|
|
|
|
// }
|
|
|
|
// }
|
2019-08-07 06:02:36 +01:00
|
|
|
|
2020-02-19 23:57:07 +00:00
|
|
|
export default
|
|
|
|
// @connect(mapStateToProps, mapDispatchToProps)
|
2019-08-07 06:02:36 +01:00
|
|
|
@injectIntl
|
|
|
|
class TrendsPanel extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
trends: ImmutablePropTypes.list.isRequired,
|
2020-02-19 23:57:07 +00:00
|
|
|
// fetchTrends: PropTypes.func.isRequired,
|
2019-08-07 06:02:36 +01:00
|
|
|
intl: PropTypes.object.isRequired,
|
2020-02-19 23:57:07 +00:00
|
|
|
}
|
2019-08-07 06:02:36 +01:00
|
|
|
|
|
|
|
componentDidMount () {
|
2020-02-19 23:57:07 +00:00
|
|
|
// this.props.fetchTrends()
|
2019-08-07 06:02:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-02-19 23:57:07 +00:00
|
|
|
const { intl, trends } = this.props
|
2019-08-07 06:02:36 +01:00
|
|
|
|
2020-02-08 06:12:01 +00:00
|
|
|
// !!! TESTING !!!
|
|
|
|
// if (trends.isEmpty()) {
|
2020-02-19 23:57:07 +00:00
|
|
|
// return null
|
2020-02-08 06:12:01 +00:00
|
|
|
// }
|
2019-08-07 06:02:36 +01:00
|
|
|
|
|
|
|
return (
|
2020-02-21 00:57:29 +00:00
|
|
|
<PanelLayout
|
|
|
|
noPadding
|
|
|
|
title={intl.formatMessage(messages.title)}
|
|
|
|
footerButtonTitle={intl.formatMessage(messages.show_all)}
|
|
|
|
footerButtonTo='/explore'
|
|
|
|
>
|
2020-02-19 23:57:07 +00:00
|
|
|
<div className={_s.default}>
|
2020-02-08 06:12:01 +00:00
|
|
|
{ /* trends && trends.map(hashtag => (
|
2019-08-07 06:02:36 +01:00
|
|
|
<TrendingItem key={hashtag.get('name')} hashtag={hashtag} />
|
2020-02-08 06:12:01 +00:00
|
|
|
)) */ }
|
2020-03-27 15:29:52 +00:00
|
|
|
<TrendingItem index='1' />
|
|
|
|
<TrendingItem index='2' />
|
|
|
|
<TrendingItem index='3' />
|
|
|
|
<TrendingItem index='4' />
|
2019-08-07 06:02:36 +01:00
|
|
|
</div>
|
|
|
|
</PanelLayout>
|
2020-02-19 23:57:07 +00:00
|
|
|
)
|
2019-08-07 06:02:36 +01:00
|
|
|
}
|
2020-02-19 23:57:07 +00:00
|
|
|
}
|