Skip to content

Commit 3b49619

Browse files
committed
Revert "Add slices for site header, footer, and CTAs; refactor layout to use slices"
This reverts commit 32cd271. Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent c36f147 commit 3b49619

File tree

10 files changed

+16
-72
lines changed

10 files changed

+16
-72
lines changed

gatsby-node.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,37 +52,12 @@ if (process.env.CI === "true") {
5252
const { loadRedirects } = require("./src/utils/redirects.js");
5353

5454
exports.createPages = async ({ actions, graphql, reporter }) => {
55-
const { createRedirect, createSlice } = actions;
55+
const { createRedirect } = actions;
5656
const redirects = loadRedirects();
5757
redirects.forEach(redirect => createRedirect(redirect)); // Handles all hardcoded ones dynamically
5858
// Create Pages
5959
const { createPage } = actions;
6060

61-
createSlice({
62-
id: "site-header",
63-
component: path.resolve("./src/slices/site-header.js"),
64-
});
65-
66-
createSlice({
67-
id: "site-footer",
68-
component: path.resolve("./src/slices/site-footer.js"),
69-
});
70-
71-
createSlice({
72-
id: "cta-bottom",
73-
component: path.resolve("./src/slices/cta-bottom.js"),
74-
});
75-
76-
createSlice({
77-
id: "cta-fullwidth",
78-
component: path.resolve("./src/slices/cta-fullwidth.js"),
79-
});
80-
81-
createSlice({
82-
id: "cta-imageonly",
83-
component: path.resolve("./src/slices/cta-imageonly.js"),
84-
});
85-
8661
const envCreatePage = (props) => {
8762
if (process.env.CI === "true") {
8863
const { path, matchPath, ...rest } = props;

root-wrapper.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from "react";
22
import { MDXProvider } from "@mdx-js/react";
33
import Code from "./src/components/CodeBlock";
4-
import { Slice } from "gatsby";
4+
import CTA_ImageOnly from "./src/components/Call-To-Actions/CTA_ImageOnly";
5+
import CTA_FullWidth from "./src/components/Call-To-Actions/CTA_FullWidth";
6+
import CTA_Bottom from "./src/components/Call-To-Actions/CTA_Bottom";
57
import { ContextWrapper } from "./context-wrapper";
68

79
// Custom image component for better CLS scores
@@ -39,9 +41,9 @@ const components = {
3941
}
4042
},
4143
img: OptimizedImage,
42-
CTA_ImageOnly: (props) => <Slice alias="cta-imageonly" sliceContext={props} />, // slice to avoid page rebuilds on CTA tweaks
43-
CTA_FullWidth: (props) => <Slice alias="cta-fullwidth" sliceContext={props} />, // slice to avoid page rebuilds on CTA tweaks
44-
CTA_Bottom: (props) => <Slice alias="cta-bottom" sliceContext={props} />
44+
CTA_ImageOnly,
45+
CTA_FullWidth,
46+
CTA_Bottom
4547
};
4648

4749
export const wrapRootElement = ({ element }) => (

src/components/layout.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,24 @@
99

1010
import React from "react";
1111
import PropTypes from "prop-types";
12-
import { Slice } from "gatsby";
1312
import ScrollToTopBtn from "./Scrolltotop-button";
13+
import Navigation from "../sections/General/Navigation";
14+
import Footer from "../sections/General/Footer";
1415
// import TopPromotionalBanner from "./TopPromotionalBanner";
1516
import { GlobalStyle } from "../sections/app.style";
17+
import CookieConsent from "./CookieConsent";
1618

1719
const Layout = ({ children }) => {
1820

1921
return (
2022
<>
2123
<GlobalStyle />
2224
{/* <TopPromotionalBanner /> */}
23-
<Slice alias="site-header" />
25+
<Navigation/>
26+
<CookieConsent />
2427
{children}
2528
<ScrollToTopBtn />
26-
<Slice alias="site-footer" />
29+
<Footer location={children.props.location} />
2730
</>
2831
);
2932
};

src/sections/General/Footer/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import Button from "../../../reusecore/Button";
77
import FooterWrapper from "./footer.style";
88
import bubblesElement from "./images/bubbles-element.svg";
99

10-
const Footer = ({ location: locationProp }) => {
10+
const Footer = ({ location }) => {
1111
var currentYear = new Date().getFullYear();
12-
const pathname = locationProp?.pathname || (typeof window !== "undefined" ? window.location.pathname : "/");
1312

1413
const getUrl = (pathname) => {
1514
// remove ".html" that results in live production build
@@ -350,7 +349,7 @@ const Footer = ({ location: locationProp }) => {
350349
<ul className="misc-links">
351350
<li className="edit-page">
352351
<a
353-
href={getUrl(pathname)}
352+
href={getUrl(location.pathname)}
354353
target="_blank"
355354
rel="noreferrer"
356355
>

src/slices/cta-bottom.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/slices/cta-fullwidth.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/slices/cta-imageonly.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/slices/site-footer.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/slices/site-header.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/templates/lite-placeholder.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import SEO from "../components/seo";
33

44
const LitePlaceholder = ({ pageContext, location }) => {
55
const {
6+
entity = "page",
67
heading = "Content disabled in lite mode",
78
description = "This route is intentionally skipped when BUILD_FULL_SITE=false.",
89
} = pageContext;

0 commit comments

Comments
 (0)