Revert "[Ivan Diaz] - Update react-router"

This reverts commit 6b1aa7aa60.

Conflicts:
	src/app/main/main-layout-header.js
	src/app/main/main-layout.js
	src/core-components/button.js
This commit is contained in:
Ivan Diaz 2015-10-17 20:30:33 -03:00
parent fb71f26f46
commit 440d9bb469
6 changed files with 20 additions and 19 deletions

View File

@ -52,7 +52,7 @@
"react-document-title": "^1.0.2",
"react-google-recaptcha": "^0.4.0",
"react-motion": "^0.3.0",
"react-router": "^1.0.0-rc1",
"react-router": "^0.13.x",
"reflux": "^0.2.9",
"run-sequence": "^1.1.1",
"superagent": "^1.2.0",

View File

@ -13,7 +13,8 @@ var App = React.createClass({
render() {
return (
<div>
{this.props.children}
<RouteHandler params={this.props.params}
query={this.props.query} />
</div>
);
},

View File

@ -1,6 +1,5 @@
import React from 'react/addons';
import {Router, Route, IndexRoute} from 'react-router';
import CreateBrowserHistory from 'react-router/node_modules/history/lib/createBrowserHistory';
import {Route, NotFoundRoute, DefaultRoute} from 'react-router';
import App from 'app/App';
import DemoPage from 'app/demo/components-demo-page';
@ -11,16 +10,14 @@ import MainSignUpPage from 'app/main/main-signup/main-sign
export default (
<Router history={CreateBrowserHistory()}>
<Route component={App} path='/'>
<Route handler={App} path='/'>
<Route path='/app' component={MainLayout}>
<IndexRoute component={MainHomePage} />
<Route path='signup' component={MainSignUpPage}/>
</Route>
<Route name='main' path='/app' handler={MainLayout}>
<DefaultRoute name='home' handler={MainHomePage} />
<Route name='signup' path='/app/signup' handler={MainSignUpPage}/>
</Route>
<Route name='Demo' path='demo' component={DemoPage} />
<Route name='Demo' path='/demo' handler={DemoPage} />
</Route>
</Router>
</Route>
);

View File

@ -8,4 +8,6 @@ if ( process.env.NODE_ENV !== 'production' ) {
window.React = React;
}
React.render(routes, document.getElementById('app'));
Router.run(routes, Router.HistoryLocation, (Handler, state) => {
React.render(<Handler params={state.params} query={state.query} />, document.getElementById('app'));
});

View File

@ -1,4 +1,5 @@
import React from 'react/addons';
import {RouteHandler} from 'react-router';
import MainHeader from 'app/main/main-layout-header';
import MainFooter from 'app/main/main-layout-footer';
@ -12,9 +13,9 @@ var MainLayout = React.createClass({
<MainHeader />
<div className="main-layout--content">
{this.props.children}
<RouteHandler params={this.props.params}
query={this.props.query} />
</div>
<MainFooter />
</div>

View File

@ -1,12 +1,12 @@
import React from 'react/addons';
import classNames from 'classnames';
import {History} from 'react-router';
import {Navigation} from 'react-router';
import callback from 'lib/callback';
var Button = React.createClass({
mixins: [History],
mixins: [Navigation],
propTypes: {
children: React.PropTypes.node,
@ -49,7 +49,7 @@ var Button = React.createClass({
handleClick() {
if (this.props.route) {
this.history.pushState(null, this.props.route.to, this.props.route.query);
this.transitionTo(this.props.route.to, this.props.route.param, this.props.route.query);
}
}
});