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

Essentials/Viewport portrait/landscape selection for individual story #15127

Closed
smeagol74 opened this issue Jun 2, 2021 · 2 comments
Closed

Comments

@smeagol74
Copy link
Contributor

Is your feature request related to a problem? Please describe
Sometimes UI design differs for mobiles and mobiles with different orientations. For now Essentials/Viewport addon allows to specify for every exact story the viewport/defaultViewport param, so when user selects that story in storybook the proper viewport to be shown. That's fine and lets me to make different stories for Desktop and Mobiles. But if UI differs because of different mobile orientation, I should tell to all devs something like this "please use the Mobile story and do not forget to switch the viewport orientation to check different cases". That's not so good. I'd like to be able to specify viewport/defaultOrientation so I were able to make different stories for Mobile Landscape and Mobile Portrait orientations.

Describe the solution you'd like
I'd like to see the extended the ViewportAddonParameter with the defaultOrientation: 'portrait' | 'landscape' so ViewportToolState.isRotated to be initiated according to this value as it works for defaultViewport.

Thus it will be possible to select not only desired viewport, but also the desired viewport orientation for every single story when required.

Describe alternatives you've considered
Alternative could be the adding the ViewportAddonParameter.defaultIsRotated: boolean field, but defaultOrientation is better and easier to understand.

Are you able to assist to bring the feature to reality?
Yes, I can

Additional context
Add any other context or screenshots about the feature request here.

@camac
Copy link

camac commented Jun 15, 2023

@smeagol74
Copy link
Contributor Author

Great thanks! Filed the pull-request to update the documentation page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants