mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 13:44:04 +00:00
Remove Appetize embedded examples
Summary: These examples work sporadically, and are all based on a years-old build of UIExplorer that was once uploaded to Appetize. As a result, newer APIs such as FlatList are not supported and attempting to run their associated examples will result in an error. <img width="526" alt="screen shot 2017-04-24 at 12 21 31 pm" src="https://cloud.githubusercontent.com/assets/165856/25348155/57016f4a-28eb-11e7-92b0-a918ef1a0e5c.png"> This PR removes the prompts to run the examples. See #13644 for exploration into using `<SnackPlayer>` for these. Fixes #12300 Closes https://github.com/facebook/react-native/pull/13644 Differential Revision: D4939653 Pulled By: hramos fbshipit-source-id: 11cf564d2ceb1981d3ce700aaae40dc873b183ad
This commit is contained in:
parent
b6a7a711de
commit
3153c3baa0
@ -785,56 +785,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'
|
|
||||||
? <img alt="Run example in simulator" width="170" height="338" src="img/uiexplorer_main_android.png" />
|
|
||||||
: <img alt="Run example in simulator" width="170" height="356" src="img/uiexplorer_main_ios.png" />;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="embedded-simulator">
|
|
||||||
<p><a className="modal-button-open"><strong>Run this example</strong></a></p>
|
|
||||||
<div className="modal-button-open modal-button-open-img">
|
|
||||||
{imagePreview}
|
|
||||||
</div>
|
|
||||||
<Modal metadata={metadata} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
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 (
|
|
||||||
<div>
|
|
||||||
<div className="modal">
|
|
||||||
<div className="modal-content">
|
|
||||||
<button className="modal-button-close">×</button>
|
|
||||||
<div className="center">
|
|
||||||
<iframe className="simulator" src={url} width="256" height="550" frameborder="0" scrolling="no" />
|
|
||||||
<p>Powered by <a target="_blank" href="https://appetize.io">appetize.io</a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="modal-backdrop" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var Autodocs = React.createClass({
|
var Autodocs = React.createClass({
|
||||||
childContextTypes: {
|
childContextTypes: {
|
||||||
permalink: PropTypes.string,
|
permalink: PropTypes.string,
|
||||||
@ -880,7 +830,6 @@ var Autodocs = React.createClass({
|
|||||||
<Prism>
|
<Prism>
|
||||||
{example.content.replace(/^[\s\S]*?\*\//, '').trim()}
|
{example.content.replace(/^[\s\S]*?\*\//, '').trim()}
|
||||||
</Prism>
|
</Prism>
|
||||||
<EmbeddedSimulator shouldRender={metadata.runnable} metadata={metadata} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user