From ecb5d35f1c8d56b3fba5f5fc3848aad2f85e301d Mon Sep 17 00:00:00 2001 From: gabros20 Date: Thu, 4 Jan 2024 16:30:30 +0100 Subject: [PATCH] fixed back navigation error from what is celestia page --- src/components/sections/two-column-h2.js | 61 ++++++++++++++---------- src/pages/what-is-celestia.js | 6 ++- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/components/sections/two-column-h2.js b/src/components/sections/two-column-h2.js index 1238e85c6..f1c90615c 100644 --- a/src/components/sections/two-column-h2.js +++ b/src/components/sections/two-column-h2.js @@ -2,32 +2,43 @@ import * as React from "react"; import Image from "../imageComponent"; import { Link } from "gatsby"; -export default class TwoColumnH2 extends React.Component { - render() { - return ( -
-
-
- {this.props.title} -
-
-
-

{this.props.title}

-
-
- - {this.props.buttonPrimaryTitle} +const TwoColumnH2 = ({ + direction, + title, + image, + text, + buttonPrimaryUrl, + buttonPrimaryClass, + buttonPrimaryTitle, + buttonSecondaryUrl, + buttonSecondaryClass, + buttonSecondaryTitle, +}) => { + return ( +
+
+
+ {title} +
+
+
+

{title}

+
+
+ + {buttonPrimaryTitle} + + {buttonSecondaryTitle && ( + + {buttonSecondaryTitle} - {this.props.buttonSecondaryTitle && ( - - {this.props.buttonSecondaryTitle} - - )} -
+ )}
-
- ); - } -} +
+
+ ); +}; + +export default TwoColumnH2; diff --git a/src/pages/what-is-celestia.js b/src/pages/what-is-celestia.js index a985cc899..33e656f63 100644 --- a/src/pages/what-is-celestia.js +++ b/src/pages/what-is-celestia.js @@ -42,7 +42,11 @@ const WhatIsCelestia = () => { return () => { if (currentRefs) { - currentRefs.forEach((ref) => observer.unobserve(ref)); + currentRefs.forEach((ref) => { + if (ref instanceof Element) { + observer.unobserve(ref); + } + }); } }; }, []);