summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/animation/components/AnimationDetailContainer.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--devtools/client/inspector/animation/components/AnimationDetailContainer.js90
1 files changed, 90 insertions, 0 deletions
diff --git a/devtools/client/inspector/animation/components/AnimationDetailContainer.js b/devtools/client/inspector/animation/components/AnimationDetailContainer.js
new file mode 100644
index 0000000000..9a7b4bfd1a
--- /dev/null
+++ b/devtools/client/inspector/animation/components/AnimationDetailContainer.js
@@ -0,0 +1,90 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+const {
+ connect,
+} = require("resource://devtools/client/shared/vendor/react-redux.js");
+const {
+ createFactory,
+ PureComponent,
+} = require("resource://devtools/client/shared/vendor/react.js");
+const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
+const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js");
+
+const AnimationDetailHeader = createFactory(
+ require("resource://devtools/client/inspector/animation/components/AnimationDetailHeader.js")
+);
+const AnimatedPropertyListContainer = createFactory(
+ require("resource://devtools/client/inspector/animation/components/AnimatedPropertyListContainer.js")
+);
+
+class AnimationDetailContainer extends PureComponent {
+ static get propTypes() {
+ return {
+ addAnimationsCurrentTimeListener: PropTypes.func.isRequired,
+ animation: PropTypes.object.isRequired,
+ emitEventForTest: PropTypes.func.isRequired,
+ getAnimatedPropertyMap: PropTypes.func.isRequired,
+ getAnimationsCurrentTime: PropTypes.func.isRequired,
+ getComputedStyle: PropTypes.func.isRequired,
+ removeAnimationsCurrentTimeListener: PropTypes.func.isRequired,
+ setDetailVisibility: PropTypes.func.isRequired,
+ simulateAnimation: PropTypes.func.isRequired,
+ simulateAnimationForKeyframesProgressBar: PropTypes.func.isRequired,
+ timeScale: PropTypes.object.isRequired,
+ };
+ }
+
+ render() {
+ const {
+ addAnimationsCurrentTimeListener,
+ animation,
+ emitEventForTest,
+ getAnimatedPropertyMap,
+ getAnimationsCurrentTime,
+ getComputedStyle,
+ removeAnimationsCurrentTimeListener,
+ setDetailVisibility,
+ simulateAnimation,
+ simulateAnimationForKeyframesProgressBar,
+ timeScale,
+ } = this.props;
+
+ return dom.div(
+ {
+ className: "animation-detail-container",
+ },
+ animation
+ ? AnimationDetailHeader({
+ animation,
+ setDetailVisibility,
+ })
+ : null,
+ animation
+ ? AnimatedPropertyListContainer({
+ addAnimationsCurrentTimeListener,
+ animation,
+ emitEventForTest,
+ getAnimatedPropertyMap,
+ getAnimationsCurrentTime,
+ getComputedStyle,
+ removeAnimationsCurrentTimeListener,
+ simulateAnimation,
+ simulateAnimationForKeyframesProgressBar,
+ timeScale,
+ })
+ : null
+ );
+ }
+}
+
+const mapStateToProps = state => {
+ return {
+ animation: state.animations.selectedAnimation,
+ };
+};
+
+module.exports = connect(mapStateToProps)(AnimationDetailContainer);