From 67d49efd1ee825bb5afa090a52ee4ac69f5ff265 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 26 Jul 2019 11:46:03 +0200 Subject: [PATCH] fix: remove redundant helper and guide code from Header --- client/src/components/Header/index.js | 11 +++-------- client/src/components/layouts/Default.js | 7 +------ client/utils/getGithubPath.js | 12 ------------ 3 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 client/utils/getGithubPath.js diff --git a/client/src/components/Header/index.js b/client/src/components/Header/index.js index 03a23fcf99..80d37393fe 100644 --- a/client/src/components/Header/index.js +++ b/client/src/components/Header/index.js @@ -9,12 +9,11 @@ import { Link } from '../helpers'; import './header.css'; const propTypes = { - disableSettings: PropTypes.bool, - navigationMenu: PropTypes.element + disableSettings: PropTypes.bool }; function Header(props) { - const { disableSettings, navigationMenu } = props; + const { disableSettings } = props; return (
); diff --git a/client/src/components/layouts/Default.js b/client/src/components/layouts/Default.js index e4929acbe3..2c9220e2b6 100644 --- a/client/src/components/layouts/Default.js +++ b/client/src/components/layouts/Default.js @@ -67,7 +67,6 @@ const propTypes = { isOnline: PropTypes.bool.isRequired, isSignedIn: PropTypes.bool, landingPage: PropTypes.bool, - navigationMenu: PropTypes.element, onlineStatusChange: PropTypes.func.isRequired, pathname: PropTypes.string.isRequired, removeFlashMessage: PropTypes.func.isRequired, @@ -131,7 +130,6 @@ class DefaultLayout extends Component { isOnline, isSignedIn, landingPage, - navigationMenu, removeFlashMessage, showFooter = true } = this.props; @@ -151,10 +149,7 @@ class DefaultLayout extends Component { -
+
diff --git a/client/utils/getGithubPath.js b/client/utils/getGithubPath.js deleted file mode 100644 index 58465c443d..0000000000 --- a/client/utils/getGithubPath.js +++ /dev/null @@ -1,12 +0,0 @@ -exports.getGithubPath = function getGithubPath(fileAbsolutePath) { - const { NODE_ENV: env } = process.env; - const guideType = env === 'production' ? 'guide' : 'mock-guide'; - let githubFilePath = - 'https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md#research-write-and-update-our-guide-articles'; - const pathIndex = fileAbsolutePath.indexOf(`/${guideType}`); - if (pathIndex > -1) { - const newPath = fileAbsolutePath.slice(pathIndex); - githubFilePath = `https://github.com/freeCodeCamp/freeCodeCamp/blob/master${newPath}`; - } - return githubFilePath; -};