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

Document how to customize the layout #69

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

jide
Copy link
Contributor

@jide jide commented Apr 7, 2016

No description provided.

@@ -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 :
Copy link
Member

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.

@jide jide force-pushed the custom-components-doc branch from b8e4e13 to e425ee8 Compare April 7, 2016 10:13
@jide
Copy link
Contributor Author

jide commented Apr 7, 2016

I added a title and rephrased a bit.

@jide jide mentioned this pull request Apr 7, 2016
@arunoda
Copy link
Member

arunoda commented Apr 7, 2016

Awesome.

@arunoda arunoda merged commit ec78da8 into storybookjs:master Apr 7, 2016
@clauderic
Copy link

clauderic commented May 12, 2016

Can this be updated? The link to layout.js is broken

@jide
Copy link
Contributor Author

jide commented May 12, 2016

@clauderic
Copy link

Great! That still does not help though, the link is still broken over there 😿

@jide
Copy link
Contributor Author

jide commented May 12, 2016

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.

@clauderic
Copy link

Hmmm okay. Doesn't seem to work anymore. It'd be great if the documentation on this was revised

@uipoet
Copy link

uipoet commented Jun 10, 2016

Attempted replacing a UI module following documentation and nothing happens, without errors.

@joaomilho
Copy link

+1

@csalvato
Copy link

Where's the documentation for this now? All links are dead. :)

ndelangen pushed a commit that referenced this pull request Apr 5, 2017
ndelangen pushed a commit that referenced this pull request Apr 5, 2017
ndelangen pushed a commit that referenced this pull request Apr 5, 2017
Provide storybook context to render
ndelangen pushed a commit that referenced this pull request Apr 5, 2017
…ils-15.3.1

react-addons-test-utils@15.3.1 untested ⚠️
@jeroenransijn
Copy link

I would like to know what the progress is on this?

@ndelangen
Copy link
Member

@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!

@usulpro usulpro added the ui label Apr 22, 2017
@shilman shilman added the misc label May 27, 2017
@binomialstew
Copy link

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 webpack.NormalModuleReplacementPlugin to replace the import of layout.js via @storybook. For example, in your webpack config:

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')
    }
  }
}

@ndelangen
Copy link
Member

Working on refactoring and improving the UI right now,

Please share your ideas and customisations so I know what users want.

See:
#4086 (comment)

@binomialstew
Copy link

I would like the ability to disable the mobile layout set by isMobileDevice. I developed a custom mobile layout before it was available in storybook. The new release with the mobile layout overrides my addon-options config and breaks my layout.

@ndelangen
Copy link
Member

@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?

@binomialstew
Copy link

@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 isMobileDevice would be sufficient, but if this were to be redone, I think the best approach would be to handle responsivity with media queries and also add an option to disable mobile layout.

@ndelangen
Copy link
Member

@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.

@ndelangen
Copy link
Member

#4086

ndelangen pushed a commit that referenced this pull request Feb 23, 2024
…-yarn-pnp-mode

Fix react joyride in yarn pnp mode
Copy link

nx-cloud bot commented Apr 24, 2024

☁️ Nx Cloud Report

CI 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 target

Sent with 💌 from NxCloud.

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

Successfully merging this pull request may close these issues.