From 9c6517f900aa47253ca6491e56d39279ed09038b Mon Sep 17 00:00:00 2001 From: Souptik Datta Date: Sat, 30 Nov 2024 14:32:20 +0530 Subject: [PATCH] feat: Add site notice to front-end Signed-off-by: Souptik Datta --- components/Layout.js | 22 ++++++++++++++++++++-- components/Navbar.js | 10 +++++++++- components/Notice.js | 29 +++++++++++++++++++++++++++++ components/Sticky.js | 16 ++++++++++++++++ pages/[slug].js | 9 ++++++--- pages/blog/[slug].js | 9 ++++++--- pages/index.js | 7 ++++++- pages/user/[slug].js | 16 ++++++++++++++-- styles/globals.css | 2 ++ 9 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 components/Notice.js create mode 100644 components/Sticky.js diff --git a/components/Layout.js b/components/Layout.js index 11eee29e..0747f581 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -1,7 +1,11 @@ -import { Box } from "@chakra-ui/react"; +import { Box, Icon } from "@chakra-ui/react"; import Footer from './Footer'; import NavBar from "./Navbar"; import Seo from "./Seo/Seo"; +import Notice from "./Notice"; +import Sticky from "./Sticky"; +import Link from 'next/link'; +import { GrAnnounce, GrWordpress } from "react-icons/gr"; const Layout = ({ children, @@ -10,6 +14,7 @@ const Layout = ({ customPageTitle, customPageDescription, customSeoMeta, + displayWPNotice = 'no', customPublishedTime, }) => { @@ -23,7 +28,20 @@ const Layout = ({ customPageDescription={customPageDescription} customSeoMeta={customSeoMeta} /> - + + { + displayWPNotice === 'yes' && data?.link && data?.link !== '' + && + +

+ Check out the WordPress site for the same content in a new experience! +

+
+ } + +
{ children }