2020-02-28 10:20:47 -05:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl'
|
|
|
|
import { fetchSuggestions, dismissSuggestion } from '../../actions/suggestions'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
|
|
|
import AccountContainer from '../../containers/account_container'
|
|
|
|
import PanelLayout from './panel_layout'
|
2020-02-24 16:56:07 -05:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
2020-02-28 10:20:47 -05:00
|
|
|
title: { id: 'media_gallery_panel.title', defaultMessage: 'Media' },
|
|
|
|
show_all: { id: 'media_gallery_panel.all', defaultMessage: 'Show all' },
|
|
|
|
})
|
2020-02-24 16:56:07 -05:00
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
suggestions: state.getIn(['suggestions', 'items']),
|
2020-02-28 10:20:47 -05:00
|
|
|
})
|
2020-02-24 16:56:07 -05:00
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
fetchSuggestions: () => dispatch(fetchSuggestions()),
|
|
|
|
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
|
|
|
|
}
|
2020-02-28 10:20:47 -05:00
|
|
|
}
|
2020-02-24 16:56:07 -05:00
|
|
|
|
2020-02-25 11:04:44 -05:00
|
|
|
export default
|
|
|
|
@connect(mapStateToProps, mapDispatchToProps)
|
2020-02-24 16:56:07 -05:00
|
|
|
@injectIntl
|
2020-02-28 10:20:47 -05:00
|
|
|
class MediaGalleryPanel extends ImmutablePureComponent {
|
2020-02-24 16:56:07 -05:00
|
|
|
|
|
|
|
static propTypes = {
|
2020-02-28 10:20:47 -05:00
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
2020-02-24 16:56:07 -05:00
|
|
|
intl: PropTypes.object.isRequired,
|
2020-02-28 10:20:47 -05:00
|
|
|
}
|
2020-02-24 16:56:07 -05:00
|
|
|
|
2020-02-28 10:20:47 -05:00
|
|
|
componentDidMount() {
|
|
|
|
// this.props.fetchSuggestions()
|
2020-02-24 16:56:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-02-28 10:20:47 -05:00
|
|
|
const { intl, account } = this.props
|
|
|
|
|
|
|
|
console.log("account:", account)
|
2020-02-24 16:56:07 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<PanelLayout
|
|
|
|
title={intl.formatMessage(messages.title)}
|
2020-02-28 10:20:47 -05:00
|
|
|
headerButtonTitle={intl.formatMessage(messages.show_all)}
|
|
|
|
headerButtonTo='/explore'
|
2020-02-24 16:56:07 -05:00
|
|
|
>
|
2020-02-28 10:20:47 -05:00
|
|
|
|
2020-02-24 16:56:07 -05:00
|
|
|
</PanelLayout>
|
2020-02-28 10:20:47 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|