-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,36 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
|
||
import styled from 'styled-components'; | ||
import Avatar from './Avatar'; | ||
import AppBar from '../AppBar/AppBar'; | ||
import Toolbar from '../Toolbar/Toolbar'; | ||
import Button from '../Button/Button'; | ||
|
||
const Wrapper = styled.div` | ||
padding: 5rem; | ||
background: ${({ theme }) => theme.material}; | ||
& > div > * { | ||
margin-right: 1rem; | ||
} | ||
`; | ||
|
||
storiesOf('Avatar', module) | ||
.addDecorator(story => ( | ||
<div | ||
style={{ | ||
padding: '5rem', | ||
background: 'teal' | ||
}} | ||
> | ||
{story()} | ||
</div> | ||
)) | ||
.addDecorator(story => <Wrapper>{story()}</Wrapper>) | ||
.add('default', () => ( | ||
<AppBar> | ||
<Toolbar | ||
style={{ justifyContent: 'space-between', paddingRight: '1rem' }} | ||
> | ||
<Button flat accent> | ||
Menu | ||
</Button> | ||
<Avatar src='https://sphoto.nasza-klasa.pl/33278012/1/square/2658174fbd.jpeg?v=1' /> | ||
</Toolbar> | ||
</AppBar> | ||
)) | ||
.add('noBorder', () => ( | ||
<AppBar> | ||
<Toolbar | ||
style={{ justifyContent: 'space-between', paddingRight: '1rem' }} | ||
> | ||
<Button flat accent> | ||
Menu | ||
</Button> | ||
<Avatar | ||
src='https://sphoto.nasza-klasa.pl/33278012/1/square/2658174fbd.jpeg?v=1' | ||
noBorder | ||
/> | ||
</Toolbar> | ||
</AppBar> | ||
)) | ||
.add('letter', () => ( | ||
<AppBar> | ||
<Toolbar | ||
style={{ justifyContent: 'space-between', paddingRight: '1rem' }} | ||
> | ||
<Button flat accent> | ||
Menu | ||
</Button> | ||
<Avatar style={{ background: 'palevioletred' }}>AK</Avatar> | ||
</Toolbar> | ||
</AppBar> | ||
)) | ||
.add('square', () => ( | ||
<AppBar> | ||
<Toolbar | ||
style={{ justifyContent: 'space-between', paddingRight: '1rem' }} | ||
> | ||
<Button flat accent> | ||
Menu | ||
</Button> | ||
<Avatar square> | ||
<span role='img' aria-label='🚀'> | ||
🚀 | ||
</span> | ||
</Avatar> | ||
</Toolbar> | ||
</AppBar> | ||
<div style={{ display: 'inline-flex' }}> | ||
<Avatar | ||
size={50} | ||
src='https://sphoto.nasza-klasa.pl/33278012/1/square/2658174fbd.jpeg?v=1' | ||
/> | ||
<Avatar | ||
noBorder | ||
size={50} | ||
src='https://sphoto.nasza-klasa.pl/33278012/1/square/2658174fbd.jpeg?v=1' | ||
/> | ||
<Avatar size={50} style={{ background: 'palevioletred' }}> | ||
AK | ||
</Avatar> | ||
<Avatar square size={50}> | ||
<span role='img' aria-label='🚀'> | ||
🚀 | ||
</span> | ||
</Avatar> | ||
</div> | ||
)); |