diff --git a/src/actions/index.js b/src/actions/index.js index afa02d8..e3bd052 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -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, - }); } \ No newline at end of file diff --git a/src/components/Intro.js b/src/components/Intro.js index e392a5a..d3f13c0 100644 --- a/src/components/Intro.js +++ b/src/components/Intro.js @@ -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); diff --git a/src/components/Navigation.js b/src/components/Navigation.js index fd3f365..765e0cf 100644 --- a/src/components/Navigation.js +++ b/src/components/Navigation.js @@ -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 ( -
- - Home - - - - Github - - - - Articles - - - - About - - - - -
- ); - } + return ( +
+ + Home + + + + Github + + + + Articles + + + + About + + + + +
+ ); - return
; } -const mapStateToProps = (state) => { - return {modal: state.contactModal.contactModal, enable: state.navigation.enable}; -} - -export default connect(mapStateToProps, {toggleContactModal})(Navigation); +export default Navigation; diff --git a/src/reducers/index.js b/src/reducers/index.js index c7375a8..1561232 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -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, }); diff --git a/src/reducers/navigationReducer.js b/src/reducers/navigationReducer.js deleted file mode 100644 index 44d22df..0000000 --- a/src/reducers/navigationReducer.js +++ /dev/null @@ -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; \ No newline at end of file