about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/avatar.js
diff options
context:
space:
mode:
authorkawax <kawaxbiz@gmail.com>2017-05-03 18:43:37 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-03 11:43:37 +0200
commit383c0b780282e4ca2a9df2086166a576eef0f296 (patch)
tree76c4b2e6d4f7633a1a4608b8983d6644329805e6 /app/javascript/mastodon/components/avatar.js
parentbf8031e984a95827fd50591ea5ae3dbc4c2f004b (diff)
Show boosted user's avatar (#2518)
* Show boosted user's avatar

* add .status__avatar-boost

* margin

* apply to notifications too.

* account__avatar-boost

* Add inline prop to Avatar component

* Add AvatarOverlay component

* rename mixins.scss

* move files for latest master

* fixed for webpack
Diffstat (limited to 'app/javascript/mastodon/components/avatar.js')
-rw-r--r--app/javascript/mastodon/components/avatar.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/javascript/mastodon/components/avatar.js b/app/javascript/mastodon/components/avatar.js
index 47f2715c7..76c561c91 100644
--- a/app/javascript/mastodon/components/avatar.js
+++ b/app/javascript/mastodon/components/avatar.js
@@ -25,9 +25,15 @@ class Avatar extends React.PureComponent {
   }
 
   render () {
-    const { src, size, staticSrc, animate } = this.props;
+    const { src, size, staticSrc, animate, inline } = this.props;
     const { hovering } = this.state;
 
+    let className = 'account__avatar';
+
+    if (inline) {
+      className = className + ' account__avatar-inline';
+    }
+
     const style = {
       ...this.props.style,
       width: `${size}px`,
@@ -43,7 +49,7 @@ class Avatar extends React.PureComponent {
 
     return (
       <div
-        className='account__avatar'
+        className={className}
         onMouseEnter={this.handleMouseEnter}
         onMouseLeave={this.handleMouseLeave}
         style={style}
@@ -58,11 +64,14 @@ Avatar.propTypes = {
   staticSrc: PropTypes.string,
   size: PropTypes.number.isRequired,
   style: PropTypes.object,
-  animate: PropTypes.bool
+  animate: PropTypes.bool,
+  inline: PropTypes.bool
 };
 
 Avatar.defaultProps = {
-  animate: false
+  animate: false,
+  size: 20,
+  inline: false
 };
 
 export default Avatar;