gab-social/app/javascript/gabsocial/components/panel/trends_panel.js

60 lines
1.5 KiB
JavaScript
Raw Normal View History

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'
import TrendingItem from '../../components/trending_item'
import PanelLayout from './panel_layout'
const messages = defineMessages({
2020-02-19 23:57:07 +00:00
title: { id:'trends.title', defaultMessage: 'Trending right now' },
})
2020-02-19 23:57:07 +00:00
// const mapStateToProps = state => ({
// trends: state.getIn(['trends', 'items']),
// })
2020-02-19 23:57:07 +00:00
// const mapDispatchToProps = dispatch => {
// return {
// fetchTrends: () => dispatch(fetchTrends()),
// }
// }
2020-02-19 23:57:07 +00:00
export default
// @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
class TrendsPanel extends ImmutablePureComponent {
static propTypes = {
trends: ImmutablePropTypes.list.isRequired,
2020-02-19 23:57:07 +00:00
// fetchTrends: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
2020-02-19 23:57:07 +00:00
}
componentDidMount () {
2020-02-19 23:57:07 +00:00
// this.props.fetchTrends()
}
render() {
2020-02-19 23:57:07 +00:00
const { intl, trends } = this.props
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
// }
return (
2020-02-08 06:12:01 +00:00
<PanelLayout title={intl.formatMessage(messages.title)}>
2020-02-19 23:57:07 +00:00
<div className={_s.default}>
2020-02-08 06:12:01 +00:00
{ /* trends && trends.map(hashtag => (
<TrendingItem key={hashtag.get('name')} hashtag={hashtag} />
2020-02-08 06:12:01 +00:00
)) */ }
<TrendingItem />
<TrendingItem />
<TrendingItem />
<TrendingItem />
<TrendingItem />
</div>
</PanelLayout>
2020-02-19 23:57:07 +00:00
)
}
2020-02-19 23:57:07 +00:00
}