about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOndřej Hruška <ondra@ondrovo.com>2017-09-20 20:34:11 +0200
committerOndřej Hruška <ondra@ondrovo.com>2017-09-20 20:34:11 +0200
commit36a35be2ad2ebd685987f0c9dac2d542edc94d9e (patch)
tree210b3948e39df773f3e51536211c62ed86846504
parent769f62d96fb34ae83e9b8197bccbb775a8cc5a5c (diff)
Appease Travis
-rw-r--r--app/javascript/glitch/components/status/header.js14
-rw-r--r--app/javascript/mastodon/components/icon_button.js17
2 files changed, 23 insertions, 8 deletions
diff --git a/app/javascript/glitch/components/status/header.js b/app/javascript/glitch/components/status/header.js
index 7f12a05b4..f741950b1 100644
--- a/app/javascript/glitch/components/status/header.js
+++ b/app/javascript/glitch/components/status/header.js
@@ -97,13 +97,13 @@ export default class StatusHeader extends React.PureComponent {
           className='status__avatar'
           onClick={this.handleAccountClick}
         >
-            {
-              friend ? (
-                <AvatarOverlay account={account} friend={friend} />
-              ) : (
-                <Avatar account={account} size={48} />
-              )
-            }
+          {
+            friend ? (
+              <AvatarOverlay account={account} friend={friend} />
+            ) : (
+              <Avatar account={account} size={48} />
+            )
+          }
         </a>
         <a
           href={account.get('url')}
diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js
index 8c5b5e0b9..ca4b14b82 100644
--- a/app/javascript/mastodon/components/icon_button.js
+++ b/app/javascript/mastodon/components/icon_button.js
@@ -73,8 +73,23 @@ export default class IconButton extends React.PureComponent {
       classes.push(this.props.className);
     }
 
+    const flipDeg = this.props.flip ? -180 : -360;
+    const rotateDeg = this.props.active ? flipDeg : 0;
+
+    const motionDefaultStyle = {
+      rotate: rotateDeg,
+    };
+
+    const springOpts = {
+      stiffness: this.props.flip ? 60 : 120,
+      damping: 7,
+    };
+    const motionStyle = {
+      rotate: this.props.animate ? spring(rotateDeg, springOpts) : 0,
+    };
+
     return (
-      <Motion defaultStyle={{ rotate: this.props.active ? (this.props.flip ? -180 : -360) : 0 }} style={{ rotate: this.props.animate ? spring(this.props.active ? (this.props.flip ? -180 : -360) : 0, { stiffness: this.props.flip ? 60 : 120, damping: 7 }) : 0 }}>
+      <Motion defaultStyle={motionDefaultStyle} style={motionStyle}>
         {({ rotate }) =>
           <button
             aria-label={this.props.title}