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

65 lines
1.8 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'
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'
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
})
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-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 => (
<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' />
</div>
</PanelLayout>
2020-02-19 23:57:07 +00:00
)
}
2020-02-19 23:57:07 +00:00
}