Created
September 11, 2020 14:16
-
-
Save rafaelrozon/911f75360bd56ae9f4a7eff4cebc5f61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import {storiesOf} from "@storybook/react"; | |
import { withKnobs, text } from '@storybook/addon-knobs'; | |
import Button from "."; | |
const storiesOf("Button", module). | |
addDecorator(withKnobs) | |
add("Default", () => { | |
return <Button type="button" text="Click me" /> | |
}). | |
add("Playground", () => { | |
const typePropLabel = 'type'; | |
const typePropOptions = { | |
submit: 'submit', | |
input: 'input' | |
}; | |
const typePropDefaultValue = typePropOptions.submit; | |
const textPropLabel = "text"; | |
const textDefaultValue = "Click me"; | |
return ( | |
<Button type={select(typePropLabel, typePropOptions, typePropDefaultValue)} text={text(textPropLabel, textDefaultValue)} /> | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment