From 4dc57ec0b1f60da52d4ec06af39bebfc249eff6a Mon Sep 17 00:00:00 2001 From: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com> Date: Thu, 30 Nov 2023 19:04:52 +0700 Subject: [PATCH] Docs: Add banner pointing to Hasura DDN PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10320 GitOrigin-RevId: 126de1412258380fd6396c52f6ddefd5e8df2ac1 --- .../BannerDismissable/DDNBanner.css | 30 +++++++++++++++++++ .../BannerDismissable/DDNBanner.tsx | 21 +++++++++++++ docs/src/theme/Navbar/index.js | 11 +++++++ 3 files changed, 62 insertions(+) create mode 100644 docs/src/components/BannerDismissable/DDNBanner.css create mode 100644 docs/src/components/BannerDismissable/DDNBanner.tsx create mode 100644 docs/src/theme/Navbar/index.js diff --git a/docs/src/components/BannerDismissable/DDNBanner.css b/docs/src/components/BannerDismissable/DDNBanner.css new file mode 100644 index 00000000000..5d6a6a3206f --- /dev/null +++ b/docs/src/components/BannerDismissable/DDNBanner.css @@ -0,0 +1,30 @@ +.banner { + background-color: #1699e2; + color: white; + display: flex; + justify-content: center; + align-items: center; + position: relative; + padding: 15px; + font-size: 16px; +} + +.close-btn { + background: none; + color: white; + border: none; + position: absolute; + right: 10px; + top: 10px; + font-size: 18px; + cursor: pointer; +} + +.close-btn:focus { + outline: none; +} + +.banner a { + color: white; + cursor: pointer; +} \ No newline at end of file diff --git a/docs/src/components/BannerDismissable/DDNBanner.tsx b/docs/src/components/BannerDismissable/DDNBanner.tsx new file mode 100644 index 00000000000..83eda711a06 --- /dev/null +++ b/docs/src/components/BannerDismissable/DDNBanner.tsx @@ -0,0 +1,21 @@ +import React, { useState } from 'react'; +import './DDNBanner.css'; + +export const DDNBanner = () => { + const [isVisible, setIsVisible] = useState(true); + + if (!isVisible) return null; + + return ( +
+
+ Hasura DDN is the future of data delivery. Click here for the Hasura DDN docs. +
+ +
+ ); +} \ No newline at end of file diff --git a/docs/src/theme/Navbar/index.js b/docs/src/theme/Navbar/index.js new file mode 100644 index 00000000000..53e58f83bdb --- /dev/null +++ b/docs/src/theme/Navbar/index.js @@ -0,0 +1,11 @@ +import React from 'react'; +import Navbar from '@theme-original/Navbar'; +import {DDNBanner} from "@site/src/components/BannerDismissable/DDNBanner"; +export default function NavbarWrapper(props) { + return ( + <> + + + + ); +}