proxy-based Twister client written with react-js
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.1 KiB

10 years ago
'use strict';
10 years ago
var React = require('react');
var RouteHandler = require('./components/RouteHandler');
var PropTypes = require('./PropTypes');
exports.Nested = React.createClass({
10 years ago
displayName: 'Nested',
render: function render() {
return React.createElement(
10 years ago
'div',
null,
React.createElement(
10 years ago
'h1',
{ className: 'Nested' },
'Nested'
),
React.createElement(RouteHandler, null)
);
}
});
exports.Foo = React.createClass({
10 years ago
displayName: 'Foo',
render: function render() {
return React.createElement(
10 years ago
'div',
{ className: 'Foo' },
'Foo'
);
}
});
exports.Bar = React.createClass({
10 years ago
displayName: 'Bar',
render: function render() {
return React.createElement(
10 years ago
'div',
{ className: 'Bar' },
'Bar'
);
}
});
exports.Baz = React.createClass({
10 years ago
displayName: 'Baz',
render: function render() {
return React.createElement(
10 years ago
'div',
{ className: 'Baz' },
'Baz'
);
}
});
exports.Async = React.createClass({
10 years ago
displayName: 'Async',
statics: {
delay: 10,
willTransitionTo: function willTransitionTo(transition, params, query, callback) {
setTimeout(callback, exports.Async.delay);
}
},
render: function render() {
return React.createElement(
10 years ago
'div',
{ className: 'Async' },
'Async'
);
}
});
exports.RedirectToFoo = React.createClass({
10 years ago
displayName: 'RedirectToFoo',
statics: {
willTransitionTo: function willTransitionTo(transition) {
10 years ago
transition.redirect('/foo');
}
},
render: function render() {
return null;
}
});
exports.RedirectToFooAsync = React.createClass({
10 years ago
displayName: 'RedirectToFooAsync',
statics: {
delay: 10,
willTransitionTo: function willTransitionTo(transition, params, query, callback) {
setTimeout(function () {
10 years ago
transition.redirect('/foo');
callback();
}, exports.RedirectToFooAsync.delay);
}
},
render: function render() {
return null;
}
});
exports.Abort = React.createClass({
10 years ago
displayName: 'Abort',
statics: {
willTransitionTo: function willTransitionTo(transition) {
transition.abort();
}
},
render: function render() {
return null;
}
});
exports.AbortAsync = React.createClass({
10 years ago
displayName: 'AbortAsync',
statics: {
delay: 10,
willTransitionTo: function willTransitionTo(transition, params, query, callback) {
setTimeout(function () {
transition.abort();
callback();
}, exports.AbortAsync.delay);
}
},
render: function render() {
return null;
}
});
exports.EchoFooProp = React.createClass({
10 years ago
displayName: 'EchoFooProp',
render: function render() {
return React.createElement(
10 years ago
'div',
null,
this.props.foo
);
}
});
exports.EchoBarParam = React.createClass({
10 years ago
displayName: 'EchoBarParam',
contextTypes: {
router: PropTypes.router.isRequired
},
render: function render() {
return React.createElement(
10 years ago
'div',
{ className: 'EchoBarParam' },
this.context.router.getCurrentParams().bar
);
}
});