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

@ -72,19 +72,3 @@ export const setIntro = (start=true) => async (dispatch, getState) => {
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,
});
}

View File

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

View File

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

View File

@ -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,
}); });

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;