Skip to content

Commit

Permalink
Fix WonderBlocks Library button color on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
zlateska committed Nov 15, 2024
1 parent d39e2f7 commit d305301
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/components/Modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { store as nfdPatternsStore } from "../../store";
import Content from "./Content/Content";
import Header from "./Content/Header/Header";
import Sidebar from "./Sidebar/Sidebar";
import { setSidebarDisplayMode } from "../../store/actions";

const Modal = () => {
const {
Expand All @@ -26,12 +25,14 @@ const Modal = () => {
setSidebarDisplayMode,
} = useDispatch(nfdPatternsStore);

const { isModalOpen, isEditingTemplate, editedPostType, currentView } = useSelect((select) => ({
currentView: select(nfdPatternsStore).getCurrentView(),
editedPostType: select("core/edit-site")?.getEditedPostType(),
isEditingTemplate: select("core/edit-post")?.isEditingTemplate(),
isModalOpen: select(nfdPatternsStore).isModalOpen(),
}));
const { isModalOpen, isEditingTemplate, editedPostType, currentView, renderingMode } = useSelect(
(select) => ({
currentView: select(nfdPatternsStore).getCurrentView(),
editedPostType: select("core/edit-site")?.getEditedPostType(),
isEditingTemplate: select("core/editor")?.getCurrentPostType() === "wp_template",
isModalOpen: select(nfdPatternsStore).isModalOpen(),
})
);

// Check if we are editing a template, via site editor or page.
const isSiteEditor = useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ToolbarButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ToolbarButton = () => {
<WPToolbarButton
icon={<Icon icon={rectangleGroup} />}
className={classNames(
"nfd-wba-gap-1 nfd-wba-mr-2 nfd-wba-flex !nfd-wba-h-9 !nfd-wba-min-w-[36px] nfd-wba-shrink-0 nfd-wba-bg-brand !nfd-wba-p-0 nfd-wba-text-white hover:nfd-wba-bg-brand-darker hover:nfd-wba-text-white focus-visible:nfd-wba-text-white active:nfd-wba-bg-brand-darker-10 active:!nfd-wba-text-white lg:!nfd-wba-pl-3 lg:!nfd-wba-pr-[15px]",
"nfd-wba-gap-1 nfd-wba-mr-2 nfd-wba-flex !nfd-wba-h-9 !nfd-wba-min-w-[36px] nfd-wba-shrink-0 nfd-wba-bg-brand !nfd-wba-p-0 nfd-wba-text-white hover:nfd-wba-bg-brand-darker hover:!nfd-wba-text-white focus-visible:nfd-wba-text-white active:nfd-wba-bg-brand-darker-10 active:!nfd-wba-text-white lg:!nfd-wba-pl-3 lg:!nfd-wba-pr-[15px]",
isModalOpen && "!nfd-wba-bg-dark nfd-wba-text-white"
)}
isPressed={isModalOpen}
Expand Down

0 comments on commit d305301

Please sign in to comment.