From e9d1a5e183d9cef37636ed30c23a595272dd6840 Mon Sep 17 00:00:00 2001 From: Joao Ribeiro Date: Tue, 8 Aug 2017 20:49:23 +0200 Subject: [PATCH] Add flowtype example again --- .../src/components/FlowTypeButton.js | 24 +++++++++++++++++++ .../cra-kitchen-sink/src/stories/index.js | 8 +++++++ 2 files changed, 32 insertions(+) create mode 100644 examples/cra-kitchen-sink/src/components/FlowTypeButton.js diff --git a/examples/cra-kitchen-sink/src/components/FlowTypeButton.js b/examples/cra-kitchen-sink/src/components/FlowTypeButton.js new file mode 100644 index 00000000000..3ef725f86de --- /dev/null +++ b/examples/cra-kitchen-sink/src/components/FlowTypeButton.js @@ -0,0 +1,24 @@ +// @flow +import React from 'react'; + +type PropsType = { + /** The text to be rendered in the button */ + label: string, + /** Function to be called when the button is clicked */ + onClick?: Function, + /** Boolean representing wether the button is disabled */ + disabled?: boolean, +}; + +/** Flow type button description */ +const FlowTypeButton = ({ label, onClick, disabled }: PropsType) => + ; + +FlowTypeButton.defaultProps = { + disabled: false, + onClick: () => {}, +}; + +export default FlowTypeButton; diff --git a/examples/cra-kitchen-sink/src/stories/index.js b/examples/cra-kitchen-sink/src/stories/index.js index 5fcf38c0b20..84d83c160ef 100644 --- a/examples/cra-kitchen-sink/src/stories/index.js +++ b/examples/cra-kitchen-sink/src/stories/index.js @@ -26,6 +26,7 @@ import App from '../App'; import Logger from './Logger'; import Container from './Container'; import DocgenButton from '../components/DocgenButton'; +import FlowTypeButton from '../components/FlowTypeButton'; const EVENTS = { TEST_EVENT_1: 'test-event-1', @@ -150,6 +151,13 @@ storiesOf('AddonInfo.DocgenButton', module).addWithInfo('DocgenButton', 'Some De ); +storiesOf( + 'AddonInfo.FlowTypeButton', + module +).addWithInfo('FlowTypeButton', 'Some Description', () => + +); + storiesOf('App', module).add('full app', () => ); storiesOf('Centered Button', module)