Skip to content

Commit

Permalink
feat(Avatar): Added avatar element
Browse files Browse the repository at this point in the history
  • Loading branch information
mBourges committed Nov 22, 2016
1 parent 728cc86 commit 683086e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
}
},
"dependencies": {
"classnames": "2.2.5"
"classnames": "2.2.5",
"react-autosuggest": "7.0.1"
}
}
12 changes: 12 additions & 0 deletions src/avatar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import './avatar.scss';

const Avatar = ({ image }) => (<div className="wrapper">
<img src={ image } alt="" />
</div>);

Avatar.propTypes = {
image: React.PropTypes.string
};

export default Avatar;
19 changes: 19 additions & 0 deletions src/avatar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.wrapper {
position: relative;
display: inline-block;
width: 3rem;
height: 3rem;
overflow: hidden;
font-size: 3.4rem;
color: #fff;
text-align: center;
vertical-align: middle;
background-color: #9e9e9e;
border-radius: 50%;
line-height: 0;

& img {
max-width: 100%;
height: auto;
}
}
12 changes: 11 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import Avatar from './avatar';
import Button from './button';
import Dropdown from './dropdown';
import IconAvatar from './iconAvatar';
import Input from './input';
import Pagination from './pagination';
import Snackbar from './snackbar';
import Spinner from './spinner';
import TextArea from './textArea';

const mdlReact = {
Avatar,
Button,
Dropdown,
IconAvatar,
Input,
Spinner
Pagination,
Snackbar,
Spinner,
TextArea
};

module.exports = mdlReact;
Expand Down

0 comments on commit 683086e

Please sign in to comment.