about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-07-27 19:52:16 +0200
committerThibG <thib@sitedethib.com>2018-07-28 23:25:42 +0200
commit358e3a4c3269b9da333a88d7ff886faf685277b4 (patch)
treee3033bc5e26aeeca3f34a48f15d97f840dc45a8f /app/javascript/flavours/glitch/components
parent7317b7b2313bdddf3b2d3a6c4fa7f00f2cc0f645 (diff)
Get rid of Collapsable, use CSS instead
Change inspired by 691107263c5e05973f9af9e1937abbc27430f54e
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r--app/javascript/flavours/glitch/components/collapsable.js22
1 files changed, 0 insertions, 22 deletions
diff --git a/app/javascript/flavours/glitch/components/collapsable.js b/app/javascript/flavours/glitch/components/collapsable.js
deleted file mode 100644
index 0e8b04033..000000000
--- a/app/javascript/flavours/glitch/components/collapsable.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-import Motion from 'flavours/glitch/util/optional_motion';
-import spring from 'react-motion/lib/spring';
-import PropTypes from 'prop-types';
-
-const Collapsable = ({ fullHeight, isVisible, children }) => (
-  <Motion defaultStyle={{ opacity: !isVisible ? 0 : 100, height: isVisible ? fullHeight : 0 }} style={{ opacity: spring(!isVisible ? 0 : 100), height: spring(!isVisible ? 0 : fullHeight) }}>
-    {({ opacity, height }) =>
-      (<div style={{ height: `${height}px`, overflow: 'hidden', opacity: opacity / 100, display: Math.floor(opacity) === 0 ? 'none' : 'block' }}>
-        {children}
-      </div>)
-    }
-  </Motion>
-);
-
-Collapsable.propTypes = {
-  fullHeight: PropTypes.number.isRequired,
-  isVisible: PropTypes.bool.isRequired,
-  children: PropTypes.node.isRequired,
-};
-
-export default Collapsable;