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

53 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-02-28 15:20:47 +00: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 21:56:07 +00:00
const messages = defineMessages({
2020-02-28 15:20:47 +00:00
title: { id: 'media_gallery_panel.title', defaultMessage: 'Media' },
show_all: { id: 'media_gallery_panel.all', defaultMessage: 'Show all' },
})
2020-02-24 21:56:07 +00:00
const mapStateToProps = state => ({
suggestions: state.getIn(['suggestions', 'items']),
2020-02-28 15:20:47 +00:00
})
2020-02-24 21:56:07 +00:00
const mapDispatchToProps = dispatch => {
return {
fetchSuggestions: () => dispatch(fetchSuggestions()),
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
}
2020-02-28 15:20:47 +00:00
}
2020-02-24 21:56:07 +00:00
2020-02-25 16:04:44 +00:00
export default
@connect(mapStateToProps, mapDispatchToProps)
2020-02-24 21:56:07 +00:00
@injectIntl
2020-02-28 15:20:47 +00:00
class MediaGalleryPanel extends ImmutablePureComponent {
2020-02-24 21:56:07 +00:00
static propTypes = {
2020-02-28 15:20:47 +00:00
account: ImmutablePropTypes.map.isRequired,
2020-02-24 21:56:07 +00:00
intl: PropTypes.object.isRequired,
2020-02-28 15:20:47 +00:00
}
2020-02-24 21:56:07 +00:00
2020-02-28 15:20:47 +00:00
componentDidMount() {
// this.props.fetchSuggestions()
2020-02-24 21:56:07 +00:00
}
render() {
2020-02-28 15:20:47 +00:00
const { intl, account } = this.props
console.log("account:", account)
2020-02-24 21:56:07 +00:00
return (
<PanelLayout
title={intl.formatMessage(messages.title)}
2020-02-28 15:20:47 +00:00
headerButtonTitle={intl.formatMessage(messages.show_all)}
headerButtonTo='/explore'
2020-02-24 21:56:07 +00:00
>
2020-02-28 15:20:47 +00:00
2020-02-24 21:56:07 +00:00
</PanelLayout>
2020-02-28 15:20:47 +00:00
)
}
}