-
Notifications
You must be signed in to change notification settings - Fork 218
Add default currency value for Storybook #8332
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: +935 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
This is fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming it fixes the issue, thanks @roykho! It looks like this happened because when the component was loaded in the Story Book, it didn't have a currency by default.
I'm not sure about fixing it in the components itself instead of fixing it in the story, though. 🤔 If we do expect all currencies to have minorUnit
, I don't think we need to add a guard in the component code. Instead, we could fix it in the story control setting defaultValue: currencies.USD,
. What do you think?
@Aljullu - Yeah I agree. Good catch. I just pushed up the changes. |
Sorry I just saw this now. Just to let you folks know, there was already a PR open for this here. I'm not sure why the GitHub interface didn't pick it up. We were discussing with @thealexandrelara some type issues within the story, and I kind of deprioritized it. Not sure if we should continue the work on the Storybook default there, and perhaps leave this PR as adding a default currency, if we want. |
Ah ok, since a lot of conversation has been had in your other PR I think any changes to fix this should be done there to prevent future confusions. So I will close this one. |
Sorry @roykho for not catching this earlier! I hope the work on Storybook was anyways somehow instructive and propaedeutic to your knowledge of the repo 🙏 |
This PR fixes the
can't access property "minorUnit", currency is not defined
error on the ProductPrice story.Fixes #8145
User Facing Testing
npm run storybook
and open up the Storybook page.Changelog