Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Added content wrapped in decorator #40

Closed
aray12 opened this issue Jul 15, 2016 · 3 comments
Closed

Added content wrapped in decorator #40

aray12 opened this issue Jul 15, 2016 · 3 comments

Comments

@aray12
Copy link

aray12 commented Jul 15, 2016

So if I want to provide some styling just to the component. The following example will center everything, including what addon-info adds

import React from 'react';
import { storiesOf, action } from '@kadira/storybook';

storiesOf('Button', module)
  .addDecorator(story => (<div style={{width: '100px', margin: 'auto'}}>{story()}</div>))
  .addWithInfo(
    'Standard
    `
    This should continue to be normal and not constrained by the decorator <div>
    `,
    () => (
      <button onClick={action('button clicked')}>Click Me</button>
    ),
    { inline: true, source: true, header: true }
  )

Thoughts?

@thani-sh
Copy link
Contributor

Yeah, that messes things up pretty bad. I think we should let addon developers decide that. How about exposing 2 new methods addRaw and decorate in addition to add?

cc: @arunoda

@arunoda
Copy link
Contributor

arunoda commented Jul 20, 2016

@mnmtanish basically we need some options to do this:

  • apply decorators
  • do not apply decorators

Is that? If so, I'm okay with a such an API.

May be an option to the .add as byPassDecorators.

@thani-sh
Copy link
Contributor

With the option users can only bypass decorators. With addRaw and decorate users can apply decorators exactly where they want. And adding an options object to the add method would make the API look terrible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants