2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-17 21:39:25 +01:00
|
|
|
import { connect } from 'react-redux'
|
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 DefaultLayout from '../layouts/default_layout'
|
2020-08-12 23:52:46 +01:00
|
|
|
import {
|
|
|
|
LinkFooter,
|
2020-11-07 05:19:04 +00:00
|
|
|
TrendsBreakingPanel,
|
2020-09-01 17:54:01 +01:00
|
|
|
UserSuggestionsPanel,
|
2020-08-12 23:52:46 +01:00
|
|
|
} from '../features/ui/util/async_components'
|
2020-03-25 03:08:43 +00:00
|
|
|
|
2020-08-17 21:07:16 +01:00
|
|
|
class ShortcutsPage extends React.PureComponent {
|
2020-03-25 03:08:43 +00:00
|
|
|
|
2020-07-22 04:24:26 +01:00
|
|
|
handleOnOpenEditShortcutsModal = () => {
|
2020-08-14 18:45:59 +01:00
|
|
|
this.props.dispatch(openModal(MODAL_EDIT_SHORTCUTS))
|
2020-07-22 04:24:26 +01:00
|
|
|
}
|
|
|
|
|
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-10-30 17:57:20 +00:00
|
|
|
showBackBtn
|
2020-07-22 04:24:26 +01:00
|
|
|
title={title}
|
|
|
|
page='shortcuts'
|
|
|
|
actions={[
|
|
|
|
{
|
|
|
|
icon: 'cog',
|
|
|
|
onClick: this.handleOnOpenEditShortcutsModal,
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
layout={[
|
2020-11-07 05:19:04 +00:00
|
|
|
TrendsBreakingPanel,
|
2020-09-01 17:54:01 +01:00
|
|
|
UserSuggestionsPanel,
|
2020-08-12 23:52:46 +01:00
|
|
|
LinkFooter,
|
2020-07-22 04:24:26 +01:00
|
|
|
]}
|
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>
|
|
|
|
)
|
|
|
|
}
|
2020-08-14 18:45:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
shortcuts: { id: 'shortcuts', defaultMessage: 'Shortcuts' },
|
|
|
|
})
|
|
|
|
|
|
|
|
ShortcutsPage.propTypes = {
|
|
|
|
children: PropTypes.node.isRequired,
|
|
|
|
dispatch: PropTypes.func.isRequired,
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(connect()(ShortcutsPage))
|