mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-29 18:46:20 -05:00
Merge pull request #52 from rschamp/feature/selenium-entry
Make app more transparent to Selenium
This commit is contained in:
commit
79a8d771d6
21 changed files with 47 additions and 11 deletions
|
@ -6,6 +6,7 @@ var Format = require('../../lib/format.js');
|
|||
require('./activity.scss');
|
||||
|
||||
var Activity = React.createClass({
|
||||
type: 'Activity',
|
||||
propTypes: {
|
||||
items: React.PropTypes.array
|
||||
},
|
||||
|
|
|
@ -2,6 +2,7 @@ var React = require('react');
|
|||
var classNames = require('classnames');
|
||||
|
||||
var Avatar = React.createClass({
|
||||
type: 'Avatar',
|
||||
propTypes: {
|
||||
src: React.PropTypes.string
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@ var React = require('react');
|
|||
require('./box.scss');
|
||||
|
||||
var Box = React.createClass({
|
||||
type: 'Box',
|
||||
propTypes: {
|
||||
title: React.PropTypes.string.isRequired,
|
||||
moreTitle: React.PropTypes.string,
|
||||
|
|
|
@ -7,6 +7,7 @@ require('slick-carousel/slick/slick-theme.scss');
|
|||
require('./carousel.scss');
|
||||
|
||||
var Carousel = React.createClass({
|
||||
type: 'Carousel',
|
||||
propTypes: {
|
||||
items: React.PropTypes.array
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@ var React = require('react');
|
|||
require('./footer.scss');
|
||||
|
||||
var Footer = React.createClass({
|
||||
type: 'Footer',
|
||||
render: function () {
|
||||
return (
|
||||
<div className="inner">
|
||||
|
|
|
@ -4,6 +4,7 @@ var classNames = require('classnames');
|
|||
require('./button.scss');
|
||||
|
||||
var Button = React.createClass({
|
||||
type: 'Button',
|
||||
propTypes: {
|
||||
|
||||
},
|
||||
|
|
|
@ -4,6 +4,7 @@ var classNames = require('classnames');
|
|||
require('./input.scss');
|
||||
|
||||
var Input = React.createClass({
|
||||
type: 'Input',
|
||||
propTypes: {
|
||||
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@ require('./intro.scss');
|
|||
Modal.setAppElement(document.getElementById('view'));
|
||||
|
||||
var Intro = React.createClass({
|
||||
type: 'Intro',
|
||||
propTypes: {
|
||||
projectCount: React.PropTypes.number
|
||||
},
|
||||
|
|
|
@ -5,6 +5,7 @@ var Button = require('../forms/button.jsx');
|
|||
require('./login.scss');
|
||||
|
||||
var Login = React.createClass({
|
||||
type: 'Login',
|
||||
propTypes: {
|
||||
onLogIn: React.PropTypes.func,
|
||||
error: React.PropTypes.string
|
||||
|
|
|
@ -5,6 +5,7 @@ require('./modal.scss');
|
|||
|
||||
|
||||
var Modal = React.createClass({
|
||||
type: 'Modal',
|
||||
statics: {
|
||||
setAppElement: ReactModal.setAppElement
|
||||
},
|
||||
|
|
|
@ -4,6 +4,7 @@ var classNames = require('classnames');
|
|||
require('./dropdown.scss');
|
||||
|
||||
var Dropdown = React.createClass({
|
||||
type: 'Dropdown',
|
||||
mixins: [
|
||||
require('react-onclickoutside')
|
||||
],
|
||||
|
|
|
@ -15,6 +15,7 @@ var Login = require('../login/login.jsx');
|
|||
require('./navigation.scss');
|
||||
|
||||
var Navigation = React.createClass({
|
||||
type: 'Navigation',
|
||||
mixins: [
|
||||
Api,
|
||||
Session
|
||||
|
|
|
@ -5,6 +5,7 @@ var Box = require('../box/box.jsx');
|
|||
require('./news.scss');
|
||||
|
||||
var News = React.createClass({
|
||||
type: 'News',
|
||||
propTypes: {
|
||||
items: React.PropTypes.array
|
||||
},
|
||||
|
|
|
@ -4,6 +4,7 @@ var classNames = require('classnames');
|
|||
require('./thumbnail.scss');
|
||||
|
||||
var Thumbnail = React.createClass({
|
||||
type: 'Thumbnail',
|
||||
propTypes: {
|
||||
src: React.PropTypes.string
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var Environment = {
|
||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
|
||||
API_HOST: JSON.stringify(process.env.API_HOST || 'https://api-staging.scratch.mit.edu')
|
||||
};
|
||||
|
||||
|
|
13
src/lib/renderer.jsx
Normal file
13
src/lib/renderer.jsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
var React = require('react');
|
||||
|
||||
var Renderer = {
|
||||
render: function (jsx, toElement) {
|
||||
var rendered = React.render(jsx, toElement);
|
||||
if (process.env.NODE_ENV != 'production') {
|
||||
window.renderedComponents = window.renderedComponents || [];
|
||||
window.renderedComponents.push(rendered);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Renderer;
|
|
@ -1,9 +1,9 @@
|
|||
var React = require('react');
|
||||
var Renderer = require('./lib/renderer.jsx');
|
||||
|
||||
require('./main.scss');
|
||||
|
||||
var Navigation = require('./components/navigation/navigation.jsx');
|
||||
var Footer = require('./components/footer/footer.jsx');
|
||||
|
||||
React.render(<Navigation />, document.getElementById('navigation'));
|
||||
React.render(<Footer />, document.getElementById('footer'));
|
||||
Renderer.render(<Navigation />, document.getElementById('navigation'));
|
||||
Renderer.render(<Footer />, document.getElementById('footer'));
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
var React = require('react');
|
||||
var Renderer = require('../../lib/renderer.jsx');
|
||||
|
||||
require('./about.scss');
|
||||
|
||||
var View = React.createClass({
|
||||
var About = React.createClass({
|
||||
type: 'About',
|
||||
render: function () {
|
||||
return (
|
||||
<div>
|
||||
|
@ -12,4 +14,4 @@ var View = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
React.render(<View />, document.getElementById('view'));
|
||||
Renderer.render(<About />, document.getElementById('view'));
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var React = require('react');
|
||||
var Renderer = require('../../lib/renderer.jsx');
|
||||
|
||||
var Box = require('../../components/box/box.jsx');
|
||||
var Button = require('../../components/forms/button.jsx');
|
||||
|
@ -8,7 +9,8 @@ var Input = require('../../components/forms/input.jsx');
|
|||
|
||||
require('./components.scss');
|
||||
|
||||
var View = React.createClass({
|
||||
var Components = React.createClass({
|
||||
type: 'Components',
|
||||
render: function () {
|
||||
return (
|
||||
<div className="inner">
|
||||
|
@ -35,4 +37,4 @@ var View = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
React.render(<View />, document.getElementById('view'));
|
||||
Renderer.render(<Components />, document.getElementById('view'));
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
var React = require('react');
|
||||
var Renderer = require('../../lib/renderer.jsx');
|
||||
|
||||
require('./hoc.scss');
|
||||
|
||||
var Button = require('../../components/forms/button.jsx');
|
||||
var Box = require('../../components/box/box.jsx');
|
||||
|
||||
var View = React.createClass({
|
||||
var Hoc = React.createClass({
|
||||
type: 'Hoc',
|
||||
render: function () {
|
||||
return (
|
||||
<div>
|
||||
|
@ -103,4 +105,4 @@ var View = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
React.render(<View />, document.getElementById('view'));
|
||||
Renderer.render(<Hoc />, document.getElementById('view'));
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var React = require('react');
|
||||
var Renderer = require('../../lib/renderer.jsx');
|
||||
|
||||
var Api = require('../../mixins/api.jsx');
|
||||
var Session = require('../../mixins/session.jsx');
|
||||
|
@ -11,7 +12,8 @@ var News = require('../../components/news/news.jsx');
|
|||
|
||||
require('./splash.scss');
|
||||
|
||||
var View = React.createClass({
|
||||
var Splash = React.createClass({
|
||||
type: 'Splash',
|
||||
mixins: [
|
||||
Api,
|
||||
Session
|
||||
|
@ -71,4 +73,4 @@ var View = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
React.render(<View />, document.getElementById('view'));
|
||||
Renderer.render(<Splash />, document.getElementById('view'));
|
||||
|
|
Loading…
Reference in a new issue