-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Document how to customize the layout #69
Conversation
@@ -207,6 +207,23 @@ module.exports = { | |||
} | |||
``` | |||
|
|||
This can also be used to customize the layout by duplicating the original [layout.js](https://raw.githubusercontent.com/kadirahq/react-storybook/master/src/client/ui/layout.js) file at `.storybook/layout.js` and setting webpack config like this : |
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.
Could you add a small title on top of this. Like: Customizing The UI.
b8e4e13
to
e425ee8
Compare
I added a title and rephrased a bit. |
Awesome. |
Can this be updated? The link to layout.js is broken |
@clauderic The documentation for this has moved to https://github.com/kadirahq/react-storybook/blob/master/docs/configure_storybook.md#customizing-the-ui |
Great! That still does not help though, the link is still broken over there 😿 |
Oh I see, yeah @arunda made significant changes recently. I guess it's the https://github.com/kadirahq/react-storybook/blob/master/src/client/manager/modules/ui/components/layout/index.js file now, but I did not dig more - you should be able to figure out the right configuration by changing the paths in the config and using this file instead. |
Hmmm okay. Doesn't seem to work anymore. It'd be great if the documentation on this was revised |
Attempted replacing a UI module following documentation and nothing happens, without errors. |
+1 |
Where's the documentation for this now? All links are dead. :) |
Typescript declaration updates
Provide storybook context to render
…ils-15.3.1 react-addons-test-utils@15.3.1 untested⚠️
I would like to know what the progress is on this? |
@jeroenransijn Could you open a new issue on this describing what's wrong? I'm not sure what to do with this now, and It's hard to keep track of a merged PR. Thanks! |
I know the last question here is from over a year ago, but for anyone finding this issue that would like to use their own custom layout, you can use the import { NormalModuleReplacementPlugin } from webpack
...
module.exports = (storybookBaseConfig, env) => {
storybookBaseConfig.plugins = [
// replace the import (in routes @storybook/ui/dist/modules/ui/routes.js) with your custom layout alias
new NormalModuleReplacementPlugin(/^\.\/containers\/layout$/, 'custom-layout')
]
...
storybookBaseConfig.resolve = {
alias: {
'custom-layout': path.resolve(project.basePath, '.storybook/layout.js')
}
}
} |
Working on refactoring and improving the UI right now, Please share your ideas and customisations so I know what users want. See: |
I would like the ability to disable the mobile layout set by |
@binomialstew would the new mobile layout be what you want in the ui refactor or is the custom one you have something this new one doesn't? Happy to look at your custom layout to take inspiration from. Do you think it makes sense to keep your custom layout if there's a good mobile layout in storybook itself? |
@ndelangen, the issue I have is more the implementation of the mobile layout rather than the UI itself. My main point of issue is it's triggered by user agent rather than css media queries. In my view, the default layout works well for iPad—the screen width is sufficient for the left sidebar, but still, the mobile layout is triggered and shown on iPads. Another issue I had—the mobile layout seems to override any options that were set initially, like "showAddonPanel" or "goFullScreen". I had previously set up a button to toggle the addons panel, and this negates that. I set up my storybook with media queries that hide the left sidebar and show a simplified header with a menu button where the stories are accessible—but only when the viewport is reduced to a specific width. In general, I think that determining responsive layouts with CSS rather than user agent is a better approach because what's important is usually the screen size, more than anything else. For me, having an option to disable |
@binomialstew the media-query issue is addressed in my UI refactor. the new mobile layout in this overhaul will show the component by default when loaded, regardless of settings, I might change that. |
…-yarn-pnp-mode Fix react joyride in yarn pnp mode
☁️ Nx Cloud ReportCI is running/has finished running commands for commit e425ee8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
No description provided.