Skip to content

Commit

Permalink
add actionmenut ext
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh16 committed Aug 21, 2024
1 parent ea0a3c5 commit a1fc74d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/top-bar/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface Toolbar {
breadcrumbs?: { title: string | React.ReactNode, path?: string; }[];
tools?: React.ReactNode;
actionMenu?: ActionMenu;
toolBarExtensions?: React.ReactNode[];
actionMenuExtensions?: React.ReactNode[];
}

export interface TopBarProps extends React.Props<any> {
Expand Down Expand Up @@ -103,7 +103,7 @@ const renderActionMenu = (actionMenu: ActionMenu, toolBarExts: React.ReactNode[]
const renderToolbar = (toolbar: Toolbar) => (
<div className='top-bar row' key='tool-bar'>
<div className='columns small-9 top-bar__left-side'>
{toolbar.actionMenu && renderActionMenu(toolbar.actionMenu, toolbar.toolBarExtensions)}
{toolbar.actionMenu && renderActionMenu(toolbar.actionMenu, toolbar.actionMenuExtensions)}
</div>

<div className='columns small-3 top-bar__right-side'>
Expand Down
2 changes: 1 addition & 1 deletion stories/top-bar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ storiesOf('TopBar', module)
<TopBar title='My Title' toolbar={{ actionMenu: { items: [{ action: () => alert(' here' ), title: "click here" }] } }} />
))
.add('with extension menu', () => (
<TopBar title='My Title' toolbar={{ actionMenu: { items: [{ action: () => alert(' here' ), title: "click here" }] }, toolBarExtensions: [<React.Fragment key={1}>render the custom component</React.Fragment>] }} />
<TopBar title='My Title' toolbar={{ actionMenu: { items: [{ action: () => alert(' here' ), title: "click here" }] }, actionMenuExtensions: [<React.Fragment key={1}>render the custom component</React.Fragment>] }} />
));

0 comments on commit a1fc74d

Please sign in to comment.