From 7e5b9db802b27a7e8ca3d7523655c5418977f195 Mon Sep 17 00:00:00 2001 From: Niraj Nandish Date: Fri, 9 Feb 2024 12:45:20 +0530 Subject: [PATCH 1/6] fix: menu bg colors (#433) --- apps/frontend/src/components/tiptap.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/components/tiptap.jsx b/apps/frontend/src/components/tiptap.jsx index 13be8b0bd..ec164aa62 100644 --- a/apps/frontend/src/components/tiptap.jsx +++ b/apps/frontend/src/components/tiptap.jsx @@ -7,6 +7,7 @@ import { MenuList, Text, useColorMode, + useColorModeValue, } from "@chakra-ui/react"; import { autoUpdate, @@ -273,6 +274,7 @@ function ToolBar({ editor, user }) { } function BubbleMenuBar({ editor, isLinkHover }) { + const menuBgColor = useColorModeValue("white", "gray.700"); const addLink = () => { const url = window.prompt("URL"); @@ -292,7 +294,7 @@ function BubbleMenuBar({ editor, isLinkHover }) { borderRadius="lg" overflowX="auto" id="bubble-menu" - background="white" + background={menuBgColor} > - + + {saveStatus !== null && ( + <> + + {saveStatus === "saved" && ( + <> + + Saved + + )} + {saveStatus === "saving" && ( + <> + + Saving... + + )} + {saveStatus === "error" && ( + <> + + Error + + )} + + + + )} {isEditor(user) && ( )} diff --git a/apps/frontend/src/components/schedule-menu.jsx b/apps/frontend/src/components/schedule-menu.jsx index 62d72d081..0d4dfb4ad 100644 --- a/apps/frontend/src/components/schedule-menu.jsx +++ b/apps/frontend/src/components/schedule-menu.jsx @@ -165,7 +165,7 @@ const PublishedMenu = ({ setScheduleOption("now"); } - handleSubmit(scheduleOption); + handleSubmit({ shouldPublish: scheduleOption }); onClose(); }} mr="1rem" @@ -283,7 +283,11 @@ const NotPublishedMenu = ({ setScheduleOption("now"); } - handleSubmit(scheduleOption, scheduledDate, scheduledTime); + handleSubmit({ + shouldPublish: scheduleOption, + scheduledDate, + scheduledTime, + }); onClose(); }} isDisabled={ diff --git a/package-lock.json b/package-lock.json index 447f158ed..c244c1b8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,6 +103,7 @@ "react-infinite-scroll-component": "^6.1.0", "slugify": "^1.6.6", "tiptap-markdown": "^0.8.2", + "use-debounce": "^10.0.0", "uuid": "^9.0.1", "yup": "^1.3.2" }, @@ -25089,6 +25090,17 @@ "version": "2.6.2", "license": "0BSD" }, + "node_modules/use-debounce": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/use-debounce/-/use-debounce-10.0.0.tgz", + "integrity": "sha512-XRjvlvCB46bah9IBXVnq/ACP2lxqXyZj0D9hj4K5OzNroMDpTEBg8Anuh1/UfRTRs7pLhQ+RiNxxwZu9+MVl1A==", + "engines": { + "node": ">= 16.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/use-isomorphic-layout-effect": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz",