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

Incorrect prop type in Toolbar Menu #903

Merged
merged 3 commits into from
Sep 5, 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
7 changes: 4 additions & 3 deletions components/src/core/ToolbarMenu/ToolbarMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ const useUtilityClasses = (ownerState: ToolbarMenuProps): Record<ToolbarMenuClas
return composeClasses(slots, getToolbarMenuUtilityClass, classes);
};

export type ToolbarMenuCompItem = Omit<NavItem, 'itemID'> & { itemID?: string };
export type ToolbarMenuItem = Omit<NavItem, 'itemID'> & { itemID?: string };

export type ToolbarMenuCompGroup = {
/** The color used for the text */
fontColor?: string;
/** The color used for icons */
iconColor?: string;
/** List of navigation items to render */
items: ToolbarMenuCompItem[];
items: ToolbarMenuItem[];
/** Text to display in the group header */
title?: string;
};
Expand Down Expand Up @@ -191,7 +192,7 @@ const ToolbarMenuRenderer: React.ForwardRefRenderFunction<unknown, ToolbarMenuPr
itemFontColor={group.fontColor}
title={group.title}
items={group.items.map(
(item: ToolbarMenuCompItem, itemIndex: number): NavItem =>
(item: ToolbarMenuItem, itemIndex: number): NavItem =>
Object.assign({ itemID: itemIndex.toString() }, item)
)}
/>
Expand Down
28 changes: 14 additions & 14 deletions docs/src/componentDocs/Drawer/playground/PlaygroundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const DrawerPreview: PreviewComponent = ({ data }) => {
}}
ref={containerRef}
>

<DrawerLayout
drawer={
<Drawer
Expand All @@ -224,7 +223,6 @@ const DrawerPreview: PreviewComponent = ({ data }) => {
width: persistent ? 'inherit' : 'initial',
},
'& .BluiDrawer-content': { backgroundColor: 'background.paper' },

}}
{...removeEmptyProps(rest)}
>
Expand Down Expand Up @@ -254,7 +252,8 @@ const DrawerPreview: PreviewComponent = ({ data }) => {
}
sx={{
'& .BluiDrawerLayout-drawer': { height: 330 },
}}>
}}
>
<Box
sx={{
backgroundColor: 'background.paper',
Expand All @@ -269,16 +268,18 @@ const DrawerPreview: PreviewComponent = ({ data }) => {
<>
<AppBar position="static">
<Toolbar>
{variant === 'temporary' && <IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
onClick={(): void => updateData('open', !open)}
>
<Menu />
</IconButton>}
{variant === 'temporary' && (
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2 }}
onClick={(): void => updateData('open', !open)}
>
<Menu />
</IconButton>
)}
<Typography variant="h6">Toolbar</Typography>
</Toolbar>
</AppBar>
Expand All @@ -296,7 +297,6 @@ const DrawerPreview: PreviewComponent = ({ data }) => {
</Box>
</DrawerLayout>
</Box>

</Stack>
);
};
Expand Down
Loading