From 199e69cb16f4d6a571ba8cc8a148d80d580b7a3d Mon Sep 17 00:00:00 2001 From: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:22:55 +0100 Subject: [PATCH] Docs: New version modal modularise CSS PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11004 GitOrigin-RevId: 2b28dcbe295765e228caec4e573886fb051cb0da --- ...onModal.css => NewVersionModal.module.css} | 75 ++++++++++--------- .../NewVersionModal/NewVersionModal.tsx | 39 +++++----- 2 files changed, 61 insertions(+), 53 deletions(-) rename docs/src/components/NewVersionModal/{NewVersionModal.css => NewVersionModal.module.css} (58%) diff --git a/docs/src/components/NewVersionModal/NewVersionModal.css b/docs/src/components/NewVersionModal/NewVersionModal.module.css similarity index 58% rename from docs/src/components/NewVersionModal/NewVersionModal.css rename to docs/src/components/NewVersionModal/NewVersionModal.module.css index 3d27f84c67b..f05b68a2bff 100644 --- a/docs/src/components/NewVersionModal/NewVersionModal.css +++ b/docs/src/components/NewVersionModal/NewVersionModal.module.css @@ -1,4 +1,4 @@ -.new-version-modal { +.newVersionModal { position: fixed; top: 0; left: 0; @@ -8,50 +8,52 @@ display: flex; align-items: center; justify-content: center; - z-index: 9999; /* Ensure it appears above other elements */ + z-index: 9999; } -.display-block { - display: flex; /* Change to flex to use flex properties */ -} - -.display-none { +.displayNone { display: none; } -.new-version-modal .modal-main { +.modalMain { + position: relative; background: white; padding: 50px; border-radius: 8px; max-width: 500px; width: 100%; text-align: center; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add shadow for better visibility */ + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); } @media (max-width: 600px) { - .new-version-modal .modal-main { + .modalMain { max-width: 90%; } } -.close-icon { +.closeIcon { + position: absolute; + top: 25px; + left: 25px; cursor: pointer; - position: relative; - top: -25px; - left: -20px; } -.monsta-image { +.monstaImage { } -.above-headline { +.aboveHeadline { margin-top: 1.3rem; font-weight: bold; color: var(--ifm-link-color);; } +[data-theme='dark'] .bodyText { + color: #141c22; +} + + .headline { display: block; font-size: 1.6rem; @@ -61,15 +63,32 @@ } -.body-text { -font-size: .95rem; +[data-theme='dark'] .headline { + color: #141c22; +} + +.subhead { + +} + +[data-theme='dark'] .subhead { + color: #141c22; +} + +.bodyText { + font-size: .95rem; margin-top: 2rem; margin-bottom: 2rem; } -.cta-thing { + +[data-theme='dark'] .bodyText { + color: #141c22; +} + +.ctaThing { display: block; - background-color: #21c45c; + background-color: #21c45c; color: white; padding: 10px 20px; border-radius: 5px; @@ -77,20 +96,8 @@ font-size: .95rem; margin: 0 auto; } -.cta-thing a { +.ctaThing a { color: white; font-weight: bold; text-decoration: none; -} - -html[data-theme='dark'] { - .headline { - color: #141c22; - } - .subhead { - color: #141c22; - } - .body-text { - color: #141c22; - } -} +} \ No newline at end of file diff --git a/docs/src/components/NewVersionModal/NewVersionModal.tsx b/docs/src/components/NewVersionModal/NewVersionModal.tsx index 2d34bef049d..1544fbfcccc 100644 --- a/docs/src/components/NewVersionModal/NewVersionModal.tsx +++ b/docs/src/components/NewVersionModal/NewVersionModal.tsx @@ -1,12 +1,13 @@ import React, { useEffect, useState } from 'react'; -import './NewVersionModal.css'; +import styles from './NewVersionModal.module.css'; import { useLocalStorage } from 'usehooks-ts'; import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +// @ts-ignore import monsta from './monsta.png'; export const NewVersionModal = () => { const { - siteConfig: { customFields }, + siteConfig: {customFields}, } = useDocusaurusContext(); const [lastClosed, setLastClosed] = useLocalStorage( @@ -19,7 +20,7 @@ export const NewVersionModal = () => { useEffect(() => { const currentTime = Date.now(); const oneWeek = 7 * 24 * 60 * 60 * 1000; // One week in milliseconds - // const oneWeek = 60 * 1000; // Temp one minute in milliseconds (for testing) + // const oneWeek = 10 * 1000; // Temp 10 seconds in milliseconds (for testing) if (!lastClosed || (currentTime - lastClosed > oneWeek)) { setShowModal(true); @@ -31,23 +32,23 @@ export const NewVersionModal = () => { setShowModal(false); }; - const showHideClassName = showModal ? "new-version-modal display-block" : "new-new-version-modal display-none"; - return ( -
-
e.stopPropagation()}> -
+
+
e.stopPropagation()}> +
- Hasura Logo -

INTRODUCING

-

Hasura Data Delivery Network

-
The next-generation Hasura platform is here!
-

Powerful v3 engine. Reimagined console. Multi-team federation. Simplified custom logic - integration. Enhanced developer experience. And so much more to love!

- + Hasura Logo +

INTRODUCING

+

Hasura Data Delivery Network

+
The next-generation Hasura platform is here!
+

+ Powerful v3 engine. Reimagined console. Multi-team federation. Simplified custom logic integration. Enhanced developer experience. And so much more to love!

+
); @@ -57,8 +58,8 @@ const CloseButton = () => { return ( - + ) } \ No newline at end of file