Removed Navigation hiding
Navigation no longer hides at visit to the site
This commit is contained in:
parent
5560b8b2ed
commit
c2df596c9a
|
|
@ -71,20 +71,4 @@ export const setIntro = (start=true) => async (dispatch, getState) => {
|
||||||
type: 'SET_INTRO',
|
type: 'SET_INTRO',
|
||||||
payload: start,
|
payload: start,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
export const hideNavigation = () => async (dispatch, getState) => {
|
|
||||||
|
|
||||||
dispatch({
|
|
||||||
type: 'SET_NAVIGATION',
|
|
||||||
payload: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const showNavigation = () => async (dispatch, getState) => {
|
|
||||||
|
|
||||||
dispatch({
|
|
||||||
type: 'SET_NAVIGATION',
|
|
||||||
payload: true,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import './css/Intro.css';
|
import './css/Intro.css';
|
||||||
import {hideNavigation, showNavigation} from '../actions';
|
|
||||||
import Topic from './subcomponents/Topic';
|
import Topic from './subcomponents/Topic';
|
||||||
import { ChevronDoubleUp, ChevronDoubleDown } from 'react-bootstrap-icons';
|
import { ChevronDoubleUp, ChevronDoubleDown } from 'react-bootstrap-icons';
|
||||||
|
|
||||||
|
|
@ -108,8 +107,6 @@ class Intro extends React.Component {
|
||||||
|
|
||||||
} else if (input === "down" && this.state.nextLoc >= this.topics.length) {
|
} else if (input === "down" && this.state.nextLoc >= this.topics.length) {
|
||||||
// Set something to happen when you reach the end
|
// Set something to happen when you reach the end
|
||||||
this.props.showNavigation();
|
|
||||||
localStorage.setItem('intro', true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -123,11 +120,6 @@ class Intro extends React.Component {
|
||||||
|
|
||||||
document.title = "HomePage"; // Set document title
|
document.title = "HomePage"; // Set document title
|
||||||
|
|
||||||
// Hide the navigation
|
|
||||||
if (!localStorage.getItem('intro')) {
|
|
||||||
this.props.hideNavigation();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Topics to display in intro
|
// Topics to display in intro
|
||||||
|
|
@ -178,4 +170,4 @@ const mapStateToProps = (state) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, {hideNavigation, showNavigation})(Intro);
|
export default connect(mapStateToProps, {})(Intro);
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,36 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import {toggleContactModal} from '../actions'
|
|
||||||
import './css/Navigation.css';
|
import './css/Navigation.css';
|
||||||
import { HouseDoor, FileEarmarkPerson, Github, Envelope, Book } from 'react-bootstrap-icons';
|
import { HouseDoor, FileEarmarkPerson, Github, Envelope, Book } from 'react-bootstrap-icons';
|
||||||
import ContactModal from './subcomponents/ContactModal';
|
import ContactModal from './subcomponents/ContactModal';
|
||||||
|
|
||||||
const Navigation = (props) => {
|
const Navigation = (props) => {
|
||||||
if (props.enable){
|
return (
|
||||||
return (
|
<div className="Navigation">
|
||||||
<div className="Navigation">
|
<Link to="/">
|
||||||
<Link to="/">
|
Home
|
||||||
Home
|
<HouseDoor />
|
||||||
<HouseDoor />
|
</Link>
|
||||||
</Link>
|
<Link to="/github">
|
||||||
<Link to="/github">
|
Github
|
||||||
Github
|
<Github />
|
||||||
<Github />
|
</Link>
|
||||||
</Link>
|
<Link to="/articles">
|
||||||
<Link to="/articles">
|
Articles
|
||||||
Articles
|
<Book />
|
||||||
<Book />
|
</Link>
|
||||||
</Link>
|
<Link to="/about">
|
||||||
<Link to="/about">
|
About
|
||||||
About
|
<FileEarmarkPerson />
|
||||||
<FileEarmarkPerson />
|
</Link>
|
||||||
</Link>
|
<button className="end" onClick={()=>props.toggleContactModal()}>
|
||||||
<button className="end" onClick={()=>props.toggleContactModal()}>
|
Contact Me
|
||||||
Contact Me
|
<Envelope />
|
||||||
<Envelope />
|
</button>
|
||||||
</button>
|
<ContactModal show={props.modal}/>
|
||||||
<ContactModal show={props.modal}/>
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return <div></div>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
export default Navigation;
|
||||||
return {modal: state.contactModal.contactModal, enable: state.navigation.enable};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, {toggleContactModal})(Navigation);
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,11 @@ import { combineReducers } from "redux";
|
||||||
import githubReducer from './githubReducer';
|
import githubReducer from './githubReducer';
|
||||||
import contactModalReducer from "./contactModalReducer";
|
import contactModalReducer from "./contactModalReducer";
|
||||||
import introReducer from "./introReducer";
|
import introReducer from "./introReducer";
|
||||||
import navigationReducer from "./navigationReducer";
|
|
||||||
import articlesReducer from "./articlesReducer";
|
import articlesReducer from "./articlesReducer";
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
github: githubReducer,
|
github: githubReducer,
|
||||||
contactModal: contactModalReducer,
|
contactModal: contactModalReducer,
|
||||||
intro: introReducer,
|
intro: introReducer,
|
||||||
navigation: navigationReducer,
|
|
||||||
articles: articlesReducer,
|
articles: articlesReducer,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
let navigationReducer = (state={enable: true}, action) => {
|
|
||||||
switch(action.type) {
|
|
||||||
case 'SET_NAVIGATION':
|
|
||||||
return { ...state, enable: action.payload };
|
|
||||||
default:
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export default navigationReducer;
|
|
||||||
Loading…
Reference in New Issue