gab-social/app/javascript/gabsocial/pages/shortcuts_page.js

62 lines
1.4 KiB
JavaScript
Raw Normal View History

import { defineMessages, injectIntl } from 'react-intl'
2020-03-25 03:08:43 +00:00
import { openModal } from '../actions/modal'
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'
import {
LinkFooter,
TrendsPanel,
WhoToFollowPanel,
} from '../features/ui/util/async_components'
2020-03-25 03:08:43 +00: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
@injectIntl
@connect(null, mapDispatchToProps)
2020-03-25 03:08:43 +00:00
class ShortcutsPage extends PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
onOpenEditShortcutsModal: PropTypes.func.isRequired,
}
handleOnOpenEditShortcutsModal = () => {
this.props.onOpenEditShortcutsModal()
}
2020-03-25 03:08:43 +00:00
render() {
const { intl, children } = this.props
const title = intl.formatMessage(messages.shortcuts)
2020-03-25 03:08:43 +00:00
return (
<DefaultLayout
title={title}
page='shortcuts'
actions={[
{
icon: 'cog',
onClick: this.handleOnOpenEditShortcutsModal,
},
]}
layout={[
TrendsPanel,
WhoToFollowPanel,
LinkFooter,
]}
2020-03-25 03:08:43 +00:00
>
<PageTitle path={title} />
2020-03-25 03:08:43 +00:00
{children}
</DefaultLayout>
)
}
}