mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-22 13:52:48 +02:00
feat(avatars): add avatar component (#156)
This commit is contained in:
committed by
Abdullah Samman
parent
73b3616472
commit
3d41fb82c2
20
docs/avatars.stories.js
Normal file
20
docs/avatars.stories.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { storiesOf } from '@storybook/html'; // eslint-disable-line import/no-extraneous-dependencies
|
||||
import { // eslint-disable-line import/no-extraneous-dependencies
|
||||
withKnobs, radios, boolean,
|
||||
} from '@storybook/addon-knobs';
|
||||
|
||||
const stories = storiesOf('Avatars', module);
|
||||
stories.addDecorator(withKnobs);
|
||||
|
||||
stories.add('avatars', () => {
|
||||
const options = radios('class', {
|
||||
'is-small': 'is-small',
|
||||
default: '',
|
||||
'is-medium': 'is-medium',
|
||||
'is-large': 'is-large',
|
||||
}, '');
|
||||
const isRounded = boolean('is-rounded', false) ? 'is-rounded' : '';
|
||||
const selectedClasses = [isRounded, options].join(' ');
|
||||
|
||||
return `<img src="http://www.gravatar.com/avatar" class="nes-avatar ${selectedClasses}">`;
|
||||
});
|
Reference in New Issue
Block a user