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

fix(SplitButton storybook): - fix stories that use wrong prop #2138

Merged

Conversation

rivka-ungar
Copy link
Contributor

@rivka-ungar rivka-ungar commented May 23, 2024

@rivka-ungar rivka-ungar requested a review from a team as a code owner May 23, 2024 08:58
Copy link
Contributor

@YossiSaadi YossiSaadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Had a suggestion to make stories usable for users

@@ -187,7 +188,7 @@ export const SplitButtonAsThePrimaryAction = {
render: () => (
<SplitButton
children="Use template"
secondaryPositions={SplitButton.secondaryPositions.BOTTOM_END}
secondaryDialogPosition={DialogPosition.BOTTOM_START}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the secondaryDialogPosition from the SplitButton's static values. If I'm not wrong, we do not export the DialogPosition, so we want to show stories that users can just copy and use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the secondaryDialogPositions from the static values is of type SplitButtonSecondaryContentPosition and the secondaryDialogPosition is of type DialogPosition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We resolved the issue by adding SplitButtonSecondaryContentPosition type to secondaryDialogPosition, and will remove the DialogPosition type in the next major release

@@ -211,7 +212,7 @@ export const SecondarySplitButton = {
<SplitButton
children="Export to CSV"
kind={SplitButton.kinds.SECONDARY}
secondaryPositions={SplitButton.secondaryPositions.BOTTOM_MIDDLE}
secondaryDialogPosition={DialogPosition.BOTTOM_START}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Contributor

@YossiSaadi YossiSaadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!! 🚀

@rivka-ungar rivka-ungar merged commit 5f9c0a4 into master May 23, 2024
10 checks passed
@rivka-ungar rivka-ungar deleted the SplitButton---fix-stories-that-use-wrong-prop-6495343163 branch May 23, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants