Skip to content

Commit

Permalink
feat(container): merge with ods feedback and new icons
Browse files Browse the repository at this point in the history
ref: MANAGER-14461

Signed-off-by: Maxime Bajeux <[email protected]>
  • Loading branch information
Maxime Bajeux committed Dec 17, 2024
1 parent 760fdd7 commit 7271c21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import SidebarLinkTag from './SidebarLinkTag';
import { Node } from './navigation-tree/node';
import StaticLink from '@/container/nav-reshuffle/sidebar/StaticLink';
import { OsdsIcon } from '@ovhcloud/ods-components/react';
import { ODS_ICON_NAME, ODS_ICON_SIZE } from '@ovhcloud/ods-components';
import {
ODS_ICON_NAME,
ODS_ICON_SIZE,
} from '@ovhcloud/ods-components';
import { SvgIconWrapper } from '@ovh-ux/ovh-product-icons/utils/SvgIconWrapper';

export type SidebarLinkProps = {
Expand All @@ -22,8 +25,8 @@ const SidebarLink: React.FC<ComponentProps<SidebarLinkProps>> = ({
count = 0,
node = {},
linkParams = {},
handleOnClick = () => {},
handleOnEnter = () => {},
handleOnClick = () => { },
handleOnEnter = () => { },
id = '',
isShortText = false,
}: SidebarLinkProps): JSX.Element => {
Expand Down Expand Up @@ -55,16 +58,9 @@ const SidebarLink: React.FC<ComponentProps<SidebarLinkProps>> = ({
data-testid={id}
role="button"
>
<span className="flex gap-2 align-items-center justify-start">
<span className={style.button_as_div_icon}>
<SvgIconWrapper
name={node.svgIcon}
height={32}
width={32}
className="p-1 fill-white block"
/>
</span>
<span className={style.button_as_div_text}>{t(node.translation)}</span>
<span className='flex gap-2 align-items-center'>
<SvgIconWrapper name={node.svgIcon} height={32} width={32} className='p-1 fill-white block' />
{!isShortText && <span>{t(node.translation)}</span>}
</span>
<span className="flex justify-end align-items-center">
{(count as number) > 0 && (
Expand All @@ -86,4 +82,4 @@ const SidebarLink: React.FC<ComponentProps<SidebarLinkProps>> = ({
);
};

export default SidebarLink;
export default SidebarLink;
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,6 @@ $sidebar-font-size: 0.875rem;
white-space: nowrap;
}

&_icon {
height: 0;
}

&_text, &_short &_icon {
transition: opacity 0.1s ease-in 0.2s;
opacity: 1;
Expand Down

0 comments on commit 7271c21

Please sign in to comment.