From 8cfd8d351db06c71adc21cd2b41726aceb7cee5e Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Mon, 24 Apr 2017 13:31:34 -0400 Subject: [PATCH] Use SnackPlayer for API Reference doc examples. --- website/layout/AutodocsLayout.js | 72 +++++--------------------------- website/server/extractDocs.js | 6 +-- 2 files changed, 13 insertions(+), 65 deletions(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 07ec34d0845ad2..2b530685885205 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -23,6 +23,7 @@ const PropTypes = require('prop-types'); var Site = require('Site'); var slugify = require('slugify'); +var SnackPlayer = require('SnackPlayer'); var styleReferencePattern = /^[^.]+\.propTypes\.style$/; @@ -785,56 +786,6 @@ var TypeDef = React.createClass({ }, }); -var EmbeddedSimulator = React.createClass({ - render: function() { - if (!this.props.shouldRender) { - return null; - } - - var metadata = this.props.metadata; - - var imagePreview = metadata.platform === 'android' - ? Run example in simulator - : Run example in simulator; - - return ( -
-

Run this example

-
- {imagePreview} -
- -
- ); - } -}); - -var Modal = React.createClass({ - render: function() { - var metadata = this.props.metadata; - var appParams = {route: metadata.title}; - var encodedParams = encodeURIComponent(JSON.stringify(appParams)); - var url = metadata.platform === 'android' - ? `https://appetize.io/embed/q7wkvt42v6bkr0pzt1n0gmbwfr?device=nexus5&scale=65&autoplay=false&orientation=portrait&deviceColor=white¶ms=${encodedParams}` - : `https://appetize.io/embed/7vdfm9h3e6vuf4gfdm7r5rgc48?device=iphone6s&scale=60&autoplay=false&orientation=portrait&deviceColor=white¶ms=${encodedParams}`; - - return ( -
-
-
- -
-