fix: redux folder relocated and local func renamed
This commit is contained in:
committed by
Stuart Taylor
parent
6cdfbc87d8
commit
08f737a0b9
@ -11,7 +11,10 @@ import { Link } from '../helpers';
|
|||||||
|
|
||||||
import './header.css';
|
import './header.css';
|
||||||
|
|
||||||
import { toggleDisplaySideNav, toggleDisplayMenu } from '../layouts/redux';
|
import {
|
||||||
|
toggleDisplaySideNav,
|
||||||
|
toggleDisplayMenu
|
||||||
|
} from '../layouts/components/guide/redux';
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
return {
|
return {
|
||||||
@ -45,7 +48,7 @@ class Header extends Component {
|
|||||||
console.log('header unmount');
|
console.log('header unmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleDisplayMenu = () => {
|
toggleDisplayMenuLogic = () => {
|
||||||
if (this.props.onGuide) {
|
if (this.props.onGuide) {
|
||||||
this.props.toggleDisplaySideNav();
|
this.props.toggleDisplaySideNav();
|
||||||
} else {
|
} else {
|
||||||
@ -59,13 +62,13 @@ class Header extends Component {
|
|||||||
!this.menuButtonRef.current.contains(event.target) &&
|
!this.menuButtonRef.current.contains(event.target) &&
|
||||||
!this.props.onGuide
|
!this.props.onGuide
|
||||||
) {
|
) {
|
||||||
toggleDisplayMenu();
|
this.toggleDisplayMenuLogic();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleMediaChange = matches => {
|
handleMediaChange = matches => {
|
||||||
if (!matches && this.props.displayMenu) {
|
if (!matches && this.props.displayMenu) {
|
||||||
toggleDisplayMenu();
|
this.toggleDisplayMenuLogic();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,7 +123,7 @@ class Header extends Component {
|
|||||||
)}
|
)}
|
||||||
<span
|
<span
|
||||||
className='menu-button'
|
className='menu-button'
|
||||||
onClick={this.toggleDisplayMenu}
|
onClick={this.toggleDisplayMenuLogic}
|
||||||
ref={this.menuButtonRef}
|
ref={this.menuButtonRef}
|
||||||
>
|
>
|
||||||
Menu
|
Menu
|
||||||
|
@ -69,10 +69,10 @@ const propTypes = {
|
|||||||
isOnline: PropTypes.bool.isRequired,
|
isOnline: PropTypes.bool.isRequired,
|
||||||
isSignedIn: PropTypes.bool,
|
isSignedIn: PropTypes.bool,
|
||||||
landingPage: PropTypes.bool,
|
landingPage: PropTypes.bool,
|
||||||
|
onGuide: PropTypes.bool,
|
||||||
onlineStatusChange: PropTypes.func.isRequired,
|
onlineStatusChange: PropTypes.func.isRequired,
|
||||||
removeFlashMessage: PropTypes.func.isRequired,
|
removeFlashMessage: PropTypes.func.isRequired,
|
||||||
showFooter: PropTypes.bool,
|
showFooter: PropTypes.bool
|
||||||
onGuide: PropTypes.bool
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
@ -160,10 +160,7 @@ class DefaultLayout extends Component {
|
|||||||
>
|
>
|
||||||
<style>{fontawesome.dom.css()}</style>
|
<style>{fontawesome.dom.css()}</style>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<Header
|
<Header disableSettings={disableSettings} onGuide={onGuide} />
|
||||||
disableSettings={disableSettings}
|
|
||||||
onGuide={onGuide}
|
|
||||||
/>
|
|
||||||
<div className={`default-layout ${landingPage ? 'landing-page' : ''}`}>
|
<div className={`default-layout ${landingPage ? 'landing-page' : ''}`}>
|
||||||
<OfflineWarning isOnline={isOnline} isSignedIn={isSignedIn} />
|
<OfflineWarning isOnline={isOnline} isSignedIn={isSignedIn} />
|
||||||
{hasMessages ? (
|
{hasMessages ? (
|
||||||
|
@ -11,7 +11,10 @@ import Spacer from '../helpers/Spacer';
|
|||||||
import 'prismjs/themes/prism.css';
|
import 'prismjs/themes/prism.css';
|
||||||
import './guide.css';
|
import './guide.css';
|
||||||
|
|
||||||
import { toggleExpandedState, toggleDisplaySideNav } from './redux';
|
import {
|
||||||
|
toggleExpandedState,
|
||||||
|
toggleDisplaySideNav
|
||||||
|
} from './components/guide/redux';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
children: PropTypes.any,
|
children: PropTypes.any,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { createAction, handleActions } from 'redux-actions';
|
import { createAction, handleActions } from 'redux-actions';
|
||||||
|
|
||||||
import { createTypes } from '../../../utils/createTypes';
|
import { createTypes } from '../../../../../utils/createTypes';
|
||||||
|
|
||||||
export const ns = 'guideNav';
|
export const ns = 'guideNav';
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
reducer as guideNav,
|
reducer as guideNav,
|
||||||
ns as guideNavNameSpace
|
ns as guideNavNameSpace
|
||||||
} from '../components/layouts/redux';
|
} from '../components/layouts/components/guide/redux';
|
||||||
import { reducer as settings, ns as settingsNameSpace } from './settings';
|
import { reducer as settings, ns as settingsNameSpace } from './settings';
|
||||||
import {
|
import {
|
||||||
reducer as curriculumMap,
|
reducer as curriculumMap,
|
||||||
|
Reference in New Issue
Block a user