diff --git a/@src/TitleInput/TitleInput.stories.tsx b/@src/TitleInput/TitleInput.stories.tsx index f6e2f23..8afddcc 100644 --- a/@src/TitleInput/TitleInput.stories.tsx +++ b/@src/TitleInput/TitleInput.stories.tsx @@ -1,10 +1,12 @@ +import InsertDriveFile from '@material-ui/icons/InsertDriveFile'; import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react'; import * as React from 'react'; import { FaFile } from 'react-icons/fa'; +import { MdInsertDriveFile } from 'react-icons/md'; +import { TiDocument } from 'react-icons/ti'; import { Field, reduxForm } from 'redux-form'; import { length, required } from 'redux-form-validators'; - import { FormDecorator } from '../../.storybook/decorators'; import { TitleInput } from './index'; @@ -90,4 +92,66 @@ storiesOf('Atoms/TitleInput', module) )} ); + }) + .add('icon', () => { + return ( +
+
+ {React.createElement( + MyForm({ + label: 'No icon', + placeholder: '(empty)' + }) + )} +
+ +
+ +
+ {React.createElement( + MyForm({ + icon: , + label: 'Font Awesome Icons', + placeholder: '(empty)' + }) + )} +
+ +
+ +
+ {React.createElement( + MyForm({ + icon: , + label: 'Material Icons', + placeholder: '(empty)' + }) + )} +
+ +
+ +
+ {React.createElement( + MyForm({ + icon: , + label: 'Typeicons', + placeholder: '(empty)' + }) + )} +
+ +
+ +
+ {React.createElement( + MyForm({ + icon: , + label: 'Material UI Icons', + placeholder: '(empty)' + }) + )} +
+
+ ); }); diff --git a/@src/TitleInput/TitleInput.tsx b/@src/TitleInput/TitleInput.tsx index 0659433..8e132ac 100644 --- a/@src/TitleInput/TitleInput.tsx +++ b/@src/TitleInput/TitleInput.tsx @@ -169,12 +169,15 @@ class TitleInput extends React.Component { )}
- {icon &&
{icon}
} + {icon && ( +
+
{icon}
+
+ )}