Add usePlainIcon prop to NavigationDrawerItem and update NavigationDrawerSectionForWorkspaceItems
- Introduced the usePlainIcon prop in NavigationDrawerItem to allow for simplified icon rendering. - Updated NavigationDrawerSectionForWorkspaceItems to utilize the new usePlainIcon prop, enhancing customization options for menu items. These changes improve the flexibility and visual consistency of the navigation drawer components.
This commit is contained in:
+1
@@ -333,6 +333,7 @@ export const NavigationDrawerSectionForWorkspaceItems = ({
|
||||
label={t`Add menu item`}
|
||||
onClick={onAddMenuItem}
|
||||
triggerEvent="CLICK"
|
||||
usePlainIcon
|
||||
/>
|
||||
)}
|
||||
</NavigationItemDropTarget>
|
||||
|
||||
+3
-1
@@ -60,6 +60,7 @@ export type NavigationDrawerItemProps = {
|
||||
mouseUpNavigation?: boolean;
|
||||
preventCollapseOnMobile?: boolean;
|
||||
isSelectedInEditMode?: boolean;
|
||||
usePlainIcon?: boolean;
|
||||
};
|
||||
|
||||
type StyledItemProps = Pick<
|
||||
@@ -308,6 +309,7 @@ export const NavigationDrawerItem = ({
|
||||
mouseUpNavigation = false,
|
||||
preventCollapseOnMobile = false,
|
||||
isSelectedInEditMode = false,
|
||||
usePlainIcon = false,
|
||||
}: NavigationDrawerItemProps) => {
|
||||
const theme = useTheme();
|
||||
const isMobile = useIsMobile();
|
||||
@@ -387,7 +389,7 @@ export const NavigationDrawerItem = ({
|
||||
)}
|
||||
|
||||
{Icon &&
|
||||
(isNavigationMenuItemEditingEnabled ? (
|
||||
(isNavigationMenuItemEditingEnabled && !usePlainIcon ? (
|
||||
<StyledIcon>
|
||||
<NavigationMenuItemStyleIcon Icon={Icon} color={iconColor} />
|
||||
</StyledIcon>
|
||||
|
||||
Reference in New Issue
Block a user