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:
parent
0ef63d3598
commit
c0122559fa
@ -1,6 +1,4 @@
|
|||||||
import { defineMessages, injectIntl } from 'react-intl'
|
import { defineMessages, injectIntl } from 'react-intl'
|
||||||
import { MODAL_DISPLAY_OPTIONS } from '../../constants'
|
|
||||||
import { openModal } from '../../actions/modal'
|
|
||||||
import { closePopover } from '../../actions/popover'
|
import { closePopover } from '../../actions/popover'
|
||||||
import { meUsername } from '../../initial_state'
|
import { meUsername } from '../../initial_state'
|
||||||
import PopoverLayout from './popover_layout'
|
import PopoverLayout from './popover_layout'
|
||||||
@ -15,9 +13,8 @@ const messages = defineMessages({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
onOpenDisplayModal: () => {
|
onClosePopover() {
|
||||||
dispatch(closePopover())
|
dispatch(closePopover())
|
||||||
dispatch(openModal(MODAL_DISPLAY_OPTIONS))
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -28,12 +25,12 @@ class NavSettingsPopover extends PureComponent {
|
|||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
onOpenDisplayModal: PropTypes.func.isRequired,
|
onClosePopover: PropTypes.func.isRequired,
|
||||||
isXS: PropTypes.bool,
|
isXS: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOnOpenDisplayModal = () => {
|
handleOnClosePopover = () => {
|
||||||
this.props.onOpenDisplayModal()
|
this.props.onClosePopover()
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -49,7 +46,8 @@ class NavSettingsPopover extends PureComponent {
|
|||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
title: intl.formatMessage(messages.profile),
|
title: intl.formatMessage(messages.profile),
|
||||||
to: `/${meUsername}`
|
to: `/${meUsername}`,
|
||||||
|
onClick: this.handleOnClosePopover,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage(messages.help),
|
title: intl.formatMessage(messages.help),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user