]> cat aescling's git repositories - mastodon.git/commitdiff
Appease Travis
authorOndřej Hruška <ondra@ondrovo.com>
Wed, 20 Sep 2017 18:34:11 +0000 (20:34 +0200)
committerOndřej Hruška <ondra@ondrovo.com>
Wed, 20 Sep 2017 18:34:11 +0000 (20:34 +0200)
app/javascript/glitch/components/status/header.js
app/javascript/mastodon/components/icon_button.js

index 7f12a05b4c571ddd08acc6ea3d61a2b3cf5f8772..f741950b187284434289cc3088d62d7e9f17bbb6 100644 (file)
@@ -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')}
index 8c5b5e0b9931d5dcd2795d3b5ee3483dac613f6c..ca4b14b825caf356a53366b3742996d5c07bfc24 100644 (file)
@@ -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}
This page took 0.025598 seconds and 3 git commands to generate.