Docs: Add banner pointing to Hasura DDN

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10320
GitOrigin-RevId: 126de1412258380fd6396c52f6ddefd5e8df2ac1
This commit is contained in:
Sean Park-Ross 2023-11-30 19:04:52 +07:00 committed by hasura-bot
parent 5768af0ee7
commit 4dc57ec0b1
3 changed files with 62 additions and 0 deletions

View File

@ -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;
}

View File

@ -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 (
<div className="banner">
<div>
Hasura DDN is the future of data delivery.&nbsp;<a href="https://hasura.io/docs/3.0/index">Click here for the Hasura DDN docs</a>.
</div>
<button className="close-btn" onClick={() => setIsVisible(false)}>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M6 18L18 6M6 6l12 12" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
</button>
</div>
);
}

View File

@ -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 (
<>
<DDNBanner/>
<Navbar {...props} />
</>
);
}