Skip to content

Commit

Permalink
Use number with options in typescript example - fail type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
marcfallows committed May 8, 2017
1 parent 0582fed commit 07ddee7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/addon-knobs/example/typescript/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ stories.add('with all knobs', () => {
const dob = date('DOB', new Date('January 20 1887'));

const bold = boolean('Bold', false);
const color = color('Color', 'black');
const selectedColor = color('Color', 'black');
const favoriteNumber = number('Favorite Number', 42);
const comfortTemp = number('Comfort Temp', 72, { range: true, min: 60, max: 90, step: 1 });
const textDecoration = select('Decoration', {
none: 'None',
underline: 'Underline',
Expand All @@ -39,13 +41,15 @@ stories.add('with all knobs', () => {

const style = Object.assign({}, customStyle, {
fontWeight: bold ? 800: 400,
color,
color: selectedColor,
textDecoration
});

return (
<div style={style}>
I'm {name} and I was born on "{moment(dob).format("DD MMM YYYY")}"
<p>My favorite number is {favoriteNumber}.</p>
<p>My most comfortable room temperature is {comfortTemp} degrees Fahrenheit.</p>
</div>
);
});
Expand Down

0 comments on commit 07ddee7

Please sign in to comment.