From 2f5c7a3a7fdf7c0929f95d9836f4046e3b550662 Mon Sep 17 00:00:00 2001 From: Gaby Zifferman Date: Fri, 31 May 2024 12:39:25 +0200 Subject: [PATCH 1/3] rename unAuthorizedClick for unauthorizedClick, unnest mimimap styles --- .../GlobalNavigation.stories.tsx | 2 +- .../GlobalNavigationItems.d.ts | 2 +- .../GlobalNavigation/HomeButton.tsx | 4 +- src/components/navigation/MiniMap/MiniMap.tsx | 2 +- src/components/navigation/MiniMap/miniMap.css | 99 +++++++++---------- 5 files changed, 50 insertions(+), 59 deletions(-) diff --git a/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx b/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx index 6eed680b8..6b7edc59f 100644 --- a/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx +++ b/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx @@ -486,7 +486,7 @@ export const MP: Story = { minimapOptions: { overviewHref: '/', onLinkClick: link => alert(link.href), - onUnAuthorizedClick: link => alert(`unauthorized ${link?.href} `), + onUnauthorizedClick: link => alert(`unauthorized ${link?.href} `), unauthorizedLinks: ['oversight', 'dataPlatform'], links: [ { linkId: 'oversight', href: '/oversight' }, diff --git a/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts b/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts index 1ccd2b75a..7bc4055f1 100644 --- a/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts +++ b/src/components/navigation/GlobalNavigation/GlobalNavigationItems.d.ts @@ -42,6 +42,6 @@ export interface IMiniMapOptions { overviewHref: string links: MiniMapLink[] onLinkClick: (link: MiniMapLink) => void - onUnAuthorizedClick: (link?: MiniMapLink) => void + onUnauthorizedClick: (link?: MiniMapLink) => void unauthorizedLinks: MiniMapLinks[] } diff --git a/src/components/navigation/GlobalNavigation/HomeButton.tsx b/src/components/navigation/GlobalNavigation/HomeButton.tsx index d14dcbcb8..22e823d63 100644 --- a/src/components/navigation/GlobalNavigation/HomeButton.tsx +++ b/src/components/navigation/GlobalNavigation/HomeButton.tsx @@ -34,7 +34,7 @@ function MinimapWithPopover(props: MinimapWithPopoverProps) { content={() => ( { function handleLinkClick(svgLink: ISvgLink): void { const miniMapLink = props.links.find(link => link.href === svgLink.href)! - if (svgLink.isUnauthorized) props.onUnAuthorizedClick(miniMapLink) + if (svgLink.isUnauthorized) props.onUnauthorizedClick(miniMapLink) else props.onLinkClick(miniMapLink) } } diff --git a/src/components/navigation/MiniMap/miniMap.css b/src/components/navigation/MiniMap/miniMap.css index 8efd9583d..5fe049ab9 100644 --- a/src/components/navigation/MiniMap/miniMap.css +++ b/src/components/navigation/MiniMap/miniMap.css @@ -1,57 +1,48 @@ .svg-linker-root__button.svg-linker-root__button--disabled { cursor: default; - &.svg-linker-root__button--regular { - & rect:first-child { - fill: transparent; - stroke: var(--color-border); - } - - & path { - fill: var(--color-text-disabled); - } - - &:hover rect:first-child { - fill: transparent; - } - } - - &.svg-linker-root__button--drop-shadow { - & > g > g > rect { - fill: var(--mp-brand-secondary-3); - } - - & path { - fill: var(--color-text-disabled); - } - - &:hover { - filter: none; - } - } - - &.svg-linker-root__button--black { - & rect:first-child { - fill: var(--mp-brand-secondary-6); - } - - &:hover rect:first-child { - fill: var(--mp-brand-secondary-6); - } - } -} - -.svg-linker-root__button { - &.svg-linker-root__button--drop-shadow:hover { - filter: drop-shadow(0px 9px 28px rgba(0, 0, 0, 0.05)) - drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.12)) - drop-shadow(0px 6px 16px rgba(0, 0, 0, 0.08)); - } - - &.svg-linker-root__button--regular:hover rect:first-child { - fill: var(--mp-brand-primary-2); - } - - &.svg-linker-root__button--black:hover rect:first-child { - fill: var(--mp-brand-secondary-7); - } +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--regular rect:first-child { + fill: transparent; + stroke: var(--color-border); +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--regular path { + fill: var(--color-text-disabled); +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--regular:hover rect:first-child { + fill: transparent; +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--drop-shadow > g > g > rect { + fill: var(--mp-brand-secondary-3); +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--drop-shadow path { + fill: var(--color-text-disabled); +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--drop-shadow:hover { + filter: none; +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--black rect:first-child { + fill: var(--mp-brand-secondary-6); +} + +.svg-linker-root__button.svg-linker-root__button--disabled.svg-linker-root__button--black:hover rect:first-child { + fill: var(--mp-brand-secondary-6); +} + +.svg-linker-root__button.svg-linker-root__button--drop-shadow:hover { + filter: drop-shadow(0px 9px 28px rgba(0, 0, 0, 0.05)) drop-shadow(0px 3px 6px rgba(0, 0, 0, 0.12)) drop-shadow(0px 6px 16px rgba(0, 0, 0, 0.08)); +} + +.svg-linker-root__button.svg-linker-root__button--regular:hover rect:first-child { + fill: var(--mp-brand-primary-2); +} + +.svg-linker-root__button.svg-linker-root__button--black:hover rect:first-child { + fill: var(--mp-brand-secondary-7); } From fe26f646c811ebd0567debe16aabd0284347aff5 Mon Sep 17 00:00:00 2001 From: Gaby Zifferman Date: Fri, 31 May 2024 14:49:09 +0200 Subject: [PATCH 2/3] Fix bug From 8216ad1d990af567a8f857203568eb6f1ab0aa5a Mon Sep 17 00:00:00 2001 From: Gaby Zifferman Date: Fri, 31 May 2024 14:50:55 +0200 Subject: [PATCH 3/3] fix: rename branch to make it a feature branch