mirror of https://github.com/portainer/portainer
fix(sidebar): environment names on hover EE-6854 (#11755)
parent
4ef71f4aca
commit
014c491205
|
@ -64,6 +64,7 @@ function Content({ environment, onClear }: ContentProps) {
|
||||||
return (
|
return (
|
||||||
<SidebarSection
|
<SidebarSection
|
||||||
title={<Title environment={environment} onClear={onClear} />}
|
title={<Title environment={environment} onClear={onClear} />}
|
||||||
|
hoverText={environment.Name}
|
||||||
aria-label={environment.Name}
|
aria-label={environment.Name}
|
||||||
showTitleWhenOpen
|
showTitleWhenOpen
|
||||||
>
|
>
|
||||||
|
|
|
@ -4,19 +4,24 @@ import { useSidebarState } from './useSidebarState';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title: ReactNode;
|
title: ReactNode;
|
||||||
|
hoverText?: string;
|
||||||
showTitleWhenOpen?: boolean;
|
showTitleWhenOpen?: boolean;
|
||||||
'aria-label'?: string;
|
'aria-label'?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SidebarSection({
|
export function SidebarSection({
|
||||||
title,
|
title,
|
||||||
|
hoverText,
|
||||||
children,
|
children,
|
||||||
showTitleWhenOpen,
|
showTitleWhenOpen,
|
||||||
'aria-label': ariaLabel,
|
'aria-label': ariaLabel,
|
||||||
}: PropsWithChildren<Props>) {
|
}: PropsWithChildren<Props>) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SidebarSectionTitle showWhenOpen={showTitleWhenOpen}>
|
<SidebarSectionTitle
|
||||||
|
showWhenOpen={showTitleWhenOpen}
|
||||||
|
hoverText={hoverText}
|
||||||
|
>
|
||||||
{title}
|
{title}
|
||||||
</SidebarSectionTitle>
|
</SidebarSectionTitle>
|
||||||
|
|
||||||
|
@ -32,10 +37,12 @@ export function SidebarSection({
|
||||||
|
|
||||||
interface TitleProps {
|
interface TitleProps {
|
||||||
showWhenOpen?: boolean;
|
showWhenOpen?: boolean;
|
||||||
|
hoverText?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SidebarSectionTitle({
|
export function SidebarSectionTitle({
|
||||||
showWhenOpen,
|
showWhenOpen,
|
||||||
|
hoverText,
|
||||||
children,
|
children,
|
||||||
}: PropsWithChildren<TitleProps>) {
|
}: PropsWithChildren<TitleProps>) {
|
||||||
const { isOpen } = useSidebarState();
|
const { isOpen } = useSidebarState();
|
||||||
|
@ -45,7 +52,10 @@ export function SidebarSectionTitle({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className="ml-3 text-sm text-gray-3 transition-all duration-500 ease-in-out be:text-gray-6">
|
<li
|
||||||
|
title={hoverText}
|
||||||
|
className="ml-3 text-sm text-gray-3 transition-all duration-500 ease-in-out be:text-gray-6"
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue