Skip to content

Commit

Permalink
LG-4721: Fix SplitButton's menu is rendered in dark-mode regardless…
Browse files Browse the repository at this point in the history
… of value passed through `renderDarkMenu` (re-created) (#2614)

* Pass renderDarkMenu prop through SplitButton to underlying Menu

* Expose prop in storybook

* Add prop description in storybook for Menu

* Add changeset
  • Loading branch information
kraenhansen authored Dec 30, 2024
1 parent bae91b2 commit 5f9185b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-years-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/split-button': patch
---

Fix passing `renderDarkMenu` to the underlying `Menu`
2 changes: 2 additions & 0 deletions packages/menu/src/Menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export default {
},
darkMode: storybookArgTypes.darkMode,
renderDarkMenu: {
description:
'Whether the menu should always render dark, regardless of the theme context',
control: 'boolean',
},
},
Expand Down
5 changes: 5 additions & 0 deletions packages/split-button/src/SplitButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ const meta: StoryMetaType<typeof SplitButton> = {
},
argTypes: {
darkMode: storybookArgTypes.darkMode,
renderDarkMenu: {
description:
'Whether the menu should always render dark, regardless of the theme context',
control: 'boolean',
},
disabled: {
control: 'boolean',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/split-button/src/SplitButton/SplitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const SplitButton = InferredPolymorphic<SplitButtonProps, 'button'>(
onTriggerClick,
triggerAriaLabel,
onChange,
renderDarkMenu,
...rest
},
ref: React.Ref<any>,
Expand Down Expand Up @@ -109,6 +110,7 @@ export const SplitButton = InferredPolymorphic<SplitButtonProps, 'button'>(
onTriggerClick={onTriggerClick}
triggerAriaLabel={triggerAriaLabel}
onChange={onChange}
renderDarkMenu={renderDarkMenu}
/>
</LeafyGreenProvider>
</div>
Expand Down

0 comments on commit 5f9185b

Please sign in to comment.