Updated NavSettingsPopover to close on profile link click

• Updated:
- NavSettingsPopover to close on profile link click

• Removed:
- Unused code for showing display options
This commit is contained in:
mgabdev 2020-05-18 17:49:51 -04:00
parent 0ef63d3598
commit c0122559fa
1 changed files with 6 additions and 8 deletions

View File

@ -1,6 +1,4 @@
import { defineMessages, injectIntl } from 'react-intl'
import { MODAL_DISPLAY_OPTIONS } from '../../constants'
import { openModal } from '../../actions/modal'
import { closePopover } from '../../actions/popover'
import { meUsername } from '../../initial_state'
import PopoverLayout from './popover_layout'
@ -15,9 +13,8 @@ const messages = defineMessages({
})
const mapDispatchToProps = (dispatch) => ({
onOpenDisplayModal: () => {
onClosePopover() {
dispatch(closePopover())
dispatch(openModal(MODAL_DISPLAY_OPTIONS))
},
})
@ -28,12 +25,12 @@ class NavSettingsPopover extends PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
onOpenDisplayModal: PropTypes.func.isRequired,
onClosePopover: PropTypes.func.isRequired,
isXS: PropTypes.bool,
}
handleOnOpenDisplayModal = () => {
this.props.onOpenDisplayModal()
handleOnClosePopover = () => {
this.props.onClosePopover()
}
render() {
@ -49,7 +46,8 @@ class NavSettingsPopover extends PureComponent {
items={[
{
title: intl.formatMessage(messages.profile),
to: `/${meUsername}`
to: `/${meUsername}`,
onClick: this.handleOnClosePopover,
},
{
title: intl.formatMessage(messages.help),