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

Adding camelizing of story names #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dm-camelonta
Copy link

Stories with multiple words didn't work. I added a camelizing function to use instead of just toLower to support that.

Story example that didn't work previous to camelizing:
export const WithIcon = Template.bind({});

@dm-camelonta dm-camelonta reopened this Oct 13, 2022
@prantlf
Copy link
Owner

prantlf commented Nov 27, 2022

Yes, that would be an alternative how to handle stories using names made of multiple words. But is it not easier to just use the name of the story as-is? You use the same text that you see in the storybook, just in lower-case.

Storybook passes the displayable names of the stories to the sorting method. Not the exported variable name in camel-case, but the displayable name with spaces. What advantage does it have to convert the displayable name back to camel case? It would need an extra code.

So, the story named like this:

export const WithIcon = Template.bind({});

Can be currently placed at a particular position like this:

const order = {
  '*': {
    'with icon': null
  }
}

What do you think?

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.

None yet

2 participants