From 293e58cc235db6d313a16e03e18739362f89a250 Mon Sep 17 00:00:00 2001 From: mrugesh mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Fri, 22 Feb 2019 20:36:47 +0530 Subject: [PATCH] fix(certs): remove footer and nav from certs (#35333) * fix(certs): remove footer and nav from certs * fix: revert spacing on cert --- client/gatsby-browser.js | 10 ++++++++-- client/gatsby-ssr.js | 10 ++++++++-- client/src/components/layouts/Certification.js | 11 +++++++++++ client/src/components/layouts/index.js | 4 ++++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 client/src/components/layouts/Certification.js create mode 100644 client/src/components/layouts/index.js diff --git a/client/gatsby-browser.js b/client/gatsby-browser.js index 2a1d585826..b51e89793d 100644 --- a/client/gatsby-browser.js +++ b/client/gatsby-browser.js @@ -5,8 +5,11 @@ import { Provider } from 'react-redux'; import { createStore } from './src/redux/createStore'; import AppMountNotifier from './src/components/AppMountNotifier'; import GuideNavContextProvider from './src/contexts/GuideNavigationContext'; -import DefaultLayout from './src/components/layouts/Default'; -import GuideLayout from './src/components/layouts/Guide'; +import { + CertificationLayout, + DefaultLayout, + GuideLayout +} from './src/components/layouts'; const store = createStore(); @@ -35,6 +38,9 @@ export const wrapPageElement = ({ element, props }) => { ); } + if (/^\/certification(\/.*)*/.test(pathname)) { + return {element}; + } if (/^\/guide(\/.*)*/.test(pathname)) { return ( diff --git a/client/gatsby-ssr.js b/client/gatsby-ssr.js index aa941852bf..7cc4fc9022 100644 --- a/client/gatsby-ssr.js +++ b/client/gatsby-ssr.js @@ -7,8 +7,11 @@ import headComponents from './src/head'; import { createStore } from './src/redux/createStore'; import GuideNavContextProvider from './src/contexts/GuideNavigationContext'; -import DefaultLayout from './src/components/layouts/Default'; -import GuideLayout from './src/components/layouts/Guide'; +import { + CertificationLayout, + DefaultLayout, + GuideLayout +} from './src/components/layouts'; const store = createStore(); @@ -35,6 +38,9 @@ export const wrapPageElement = ({ element, props }) => { ); } + if (/^\/certification(\/.*)*/.test(pathname)) { + return {element}; + } if (/^\/guide(\/.*)*/.test(pathname)) { return ( diff --git a/client/src/components/layouts/Certification.js b/client/src/components/layouts/Certification.js new file mode 100644 index 0000000000..720c2ad6ac --- /dev/null +++ b/client/src/components/layouts/Certification.js @@ -0,0 +1,11 @@ +import React, { Fragment } from 'react'; +import PropTypes from 'prop-types'; + +function CertificationLayout({ children }) { + return {children}; +} + +CertificationLayout.displayName = 'CertificationLayout'; +CertificationLayout.propTypes = { children: PropTypes.any }; + +export default CertificationLayout; diff --git a/client/src/components/layouts/index.js b/client/src/components/layouts/index.js new file mode 100644 index 0000000000..0b6fefdef1 --- /dev/null +++ b/client/src/components/layouts/index.js @@ -0,0 +1,4 @@ +export { default as CertificationLayout } from './Certification'; +export { default as DefaultLayout } from './Default'; +export { default as GuideLayout } from './Guide'; +export { default as LearnLayout } from './Learn';