How do I get opened one, and then another. And that when you click to another area, they were closed.
React dropdown code:
<div className="header__nav">
<div className={classnames('header__nav__title', { 'is-active' : this.props.navAuthors })} onClick={this.props.toggleNavAuthors}><FormattedMessage {...messages.authors} /></div>
<ReactCSSTransitionGroup transitionName='header-menu-animation' transitionEnterTimeout={350} transitionLeave={false}>
{this.props.navAuthors ? this._renderAuthors() : null}
</ReactCSSTransitionGroup>
</div>
<div className="header__nav">
<div className={classnames('header__nav__title', { 'is-active' : this.props.nav })} onClick={this.props.toggleNav}><FormattedMessage {...messages.typefaces} /></div>
<ReactCSSTransitionGroup transitionName='header-menu-animation' transitionEnterTimeout={350} transitionLeave={false}>
{this.props.nav ? this._renderTypefaces() : null}
</ReactCSSTransitionGroup>
</div>
on redux dropdown code:
import {
SHOW_NAV,
HIDE_NAV
} from '../constants/ActionTypes'
export function toggleNav() {
return (dispatch, getState) => {
const { nav } = getState()
dispatch({
type: nav ? HIDE_NAV : SHOW_NAV
})
}
}
export function hideNav() {
return {
type: HIDE_NAV
}
}
localstuff can be managed inside the component without redux, its seams to get overcomplicated..