2020-07-22 04:24:26 +01:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl'
|
2020-03-25 03:08:43 +00:00
|
|
|
import { openModal } from '../actions/modal'
|
2020-07-22 04:24:26 +01:00
|
|
|
import { MODAL_EDIT_SHORTCUTS } from '../constants'
|
|
|
|
import PageTitle from '../features/ui/util/page_title'
|
2020-03-25 03:08:43 +00:00
|
|
|
import LinkFooter from '../components/link_footer'
|
|
|
|
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
|
|
|
|
import TrendsPanel from '../components/panel/trends_panel'
|
|
|
|
import DefaultLayout from '../layouts/default_layout'
|
|
|
|
|
2020-07-22 04:24:26 +01:00
|
|
|
const messages = defineMessages({
|
|
|
|
shortcuts: { id: 'shortcuts', defaultMessage: 'Shortcuts' },
|
|
|
|
})
|
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
onOpenEditShortcutsModal() {
|
|
|
|
dispatch(openModal(MODAL_EDIT_SHORTCUTS))
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2020-03-25 03:08:43 +00:00
|
|
|
export default
|
2020-07-22 04:24:26 +01:00
|
|
|
@injectIntl
|
|
|
|
@connect(null, mapDispatchToProps)
|
2020-03-25 03:08:43 +00:00
|
|
|
class ShortcutsPage extends PureComponent {
|
|
|
|
|
2020-07-22 04:24:26 +01:00
|
|
|
static propTypes = {
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
onOpenEditShortcutsModal: PropTypes.func.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
handleOnOpenEditShortcutsModal = () => {
|
|
|
|
this.props.onOpenEditShortcutsModal()
|
|
|
|
}
|
|
|
|
|
2020-03-25 03:08:43 +00:00
|
|
|
render() {
|
2020-07-22 04:24:26 +01:00
|
|
|
const { intl, children } = this.props
|
|
|
|
|
|
|
|
const title = intl.formatMessage(messages.shortcuts)
|
2020-03-25 03:08:43 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<DefaultLayout
|
2020-07-22 04:24:26 +01:00
|
|
|
title={title}
|
|
|
|
page='shortcuts'
|
|
|
|
actions={[
|
|
|
|
{
|
|
|
|
icon: 'cog',
|
|
|
|
onClick: this.handleOnOpenEditShortcutsModal,
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
layout={[
|
|
|
|
<TrendsPanel key='shortcuts-page-trends-panel' />,
|
|
|
|
<WhoToFollowPanel key='shortcuts-page-wtf-panel' />,
|
|
|
|
<LinkFooter key='shortcuts-page-link-footer' />,
|
|
|
|
]}
|
2020-03-25 03:08:43 +00:00
|
|
|
>
|
2020-07-22 04:24:26 +01:00
|
|
|
<PageTitle path={title} />
|
2020-03-25 03:08:43 +00:00
|
|
|
{children}
|
|
|
|
</DefaultLayout>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|