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(main-nav): Main Nav refactoring, add the Home icon #20176

Merged
merged 13 commits into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/core/admin/admin/src/components/LeftMenu.tsx
Expand Up @@ -142,7 +142,12 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }: LeftMenuProps) =
label={formatMessage({ id: 'global.home', defaultMessage: 'Home' })}
>
<NewNavLink.Icon>
<Icon as={House} color="neutral500" />
<Icon
width={`${16 / 16}rem`}
simotae14 marked this conversation as resolved.
Show resolved Hide resolved
height={`${16 / 16}rem`}
as={House}
color="neutral500"
/>
</NewNavLink.Icon>
</NewNavLink.Tooltip>
</NewNavLink.Link>
Expand Down
9 changes: 7 additions & 2 deletions packages/core/admin/admin/src/components/MainNav/NavLink.tsx
simotae14 marked this conversation as resolved.
Show resolved Hide resolved
Expand Up @@ -56,12 +56,17 @@ const TooltipImpl = ({ children, label, position = 'right' }: NavLink.TooltipPro
* Icon
* -----------------------------------------------------------------------------------------------*/
const IconImpl = ({ children }: { children: React.ReactNode }) => {
if (!children) {
return null;
}
return (
simotae14 marked this conversation as resolved.
Show resolved Hide resolved
<Flex
paddingTop={`${8 / 16}rem`}
paddingBottom={`${8 / 16}rem`}
paddingLeft={`${12 / 16}rem`}
paddingRight={`${12 / 16}rem`}
height={`${34 / 16}rem`}
width={`${52 / 16}rem`}
simotae14 marked this conversation as resolved.
Show resolved Hide resolved
justifyContent="center"
aria-hidden
as="span"
Expand All @@ -86,8 +91,8 @@ const BadgeImpl = ({ children, label }: NavLink.BadgeProps) => {
return (
<CustomBadge
position="absolute"
top="-12px"
right="-4px"
top={`-${12 / 16}rem`}
right={`-${4 / 16}rem`}
aria-label={label}
background="primary600"
textColor="neutral0"
Expand Down