Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: unnesting minimap styles #253

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
}
4 changes: 2 additions & 2 deletions src/components/navigation/GlobalNavigation/HomeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function MinimapWithPopover(props: MinimapWithPopoverProps) {
content={() => (
<MiniMap
overviewHref={props.overviewHref}
onUnAuthorizedClick={props.onUnAuthorizedClick}
onUnauthorizedClick={props.onUnauthorizedClick}
links={props.links}
onLinkClick={props.onLinkClick}
unauthorizedLinks={props.unauthorizedLinks}
Expand Down Expand Up @@ -62,7 +62,7 @@ export function HomeButton(props: HomeButtonProps) {

return (
<MinimapWithPopover
onUnAuthorizedClick={props.minimapOptions.onUnAuthorizedClick}
onUnauthorizedClick={props.minimapOptions.onUnauthorizedClick}
overviewHref={props.minimapOptions.overviewHref}
links={props.minimapOptions.links}
onLinkClick={props.minimapOptions.onLinkClick}
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/MiniMap/MiniMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Minimap = (props: IMiniMapProps) => {
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)
}
}
Expand Down
99 changes: 45 additions & 54 deletions src/components/navigation/MiniMap/miniMap.css
Original file line number Diff line number Diff line change
@@ -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);
}
Loading