Removed Navigation hiding

Navigation no longer hides at visit to the site
This commit is contained in:
Camerin Figueroa 2021-11-08 16:02:02 -05:00
parent 8423e6fc0d
commit 9185988f83
5 changed files with 27 additions and 73 deletions

View File

@ -71,20 +71,4 @@ export const setIntro = (start=true) => async (dispatch, getState) => {
type: 'SET_INTRO',
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,
});
}

View File

@ -1,7 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import './css/Intro.css';
import {hideNavigation, showNavigation} from '../actions';
import Topic from './subcomponents/Topic';
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) {
// 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
// Hide the navigation
if (!localStorage.getItem('intro')) {
this.props.hideNavigation();
}
}
// Topics to display in intro
@ -178,4 +170,4 @@ const mapStateToProps = (state) => {
}
export default connect(mapStateToProps, {hideNavigation, showNavigation})(Intro);
export default connect(mapStateToProps, {})(Intro);

View File

@ -1,45 +1,36 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import {toggleContactModal} from '../actions'
import './css/Navigation.css';
import { HouseDoor, FileEarmarkPerson, Github, Envelope, Book } from 'react-bootstrap-icons';
import ContactModal from './subcomponents/ContactModal';
const Navigation = (props) => {
if (props.enable){
return (
<div className="Navigation">
<Link to="/">
Home
<HouseDoor />
</Link>
<Link to="/github">
Github
<Github />
</Link>
<Link to="/articles">
Articles
<Book />
</Link>
<Link to="/about">
About
<FileEarmarkPerson />
</Link>
<button className="end" onClick={()=>props.toggleContactModal()}>
Contact Me
<Envelope />
</button>
<ContactModal show={props.modal}/>
</div>
);
}
return (
<div className="Navigation">
<Link to="/">
Home
<HouseDoor />
</Link>
<Link to="/github">
Github
<Github />
</Link>
<Link to="/articles">
Articles
<Book />
</Link>
<Link to="/about">
About
<FileEarmarkPerson />
</Link>
<button className="end" onClick={()=>props.toggleContactModal()}>
Contact Me
<Envelope />
</button>
<ContactModal show={props.modal}/>
</div>
);
return <div></div>;
}
const mapStateToProps = (state) => {
return {modal: state.contactModal.contactModal, enable: state.navigation.enable};
}
export default connect(mapStateToProps, {toggleContactModal})(Navigation);
export default Navigation;

View File

@ -3,13 +3,11 @@ import { combineReducers } from "redux";
import githubReducer from './githubReducer';
import contactModalReducer from "./contactModalReducer";
import introReducer from "./introReducer";
import navigationReducer from "./navigationReducer";
import articlesReducer from "./articlesReducer";
export default combineReducers({
github: githubReducer,
contactModal: contactModalReducer,
intro: introReducer,
navigation: navigationReducer,
articles: articlesReducer,
});

View File

@ -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;