Browse Source

remove strange react-router syntax

master
Julian Steinwachs 9 years ago
parent
commit
214b849afc
  1. 10
      build/app-bundle.js
  2. 4
      jsx/App.js
  3. 4
      jsx/profile/Profile.js

10
build/app-bundle.js

@ -27,7 +27,7 @@ var ReactBootstrap = require('react-bootstrap') @@ -27,7 +27,7 @@ var ReactBootstrap = require('react-bootstrap')
var React = require('react');
var Router = require('react-router');
var { Route, DefaultRoute, RouteHandler, Link } = Router;
var Route = Router.Route; var DefaultRoute = Router.DefaultRoute; var RouteHandler = Router.RouteHandler; var Link = Router.Link;
var Home = require("./home/Home.js");
var Profile = require("./profile/Profile.js");
@ -51,7 +51,7 @@ App = React.createClass({displayName: "App", @@ -51,7 +51,7 @@ App = React.createClass({displayName: "App",
getHandlerKey: function () {
var childDepth = 1; // assuming App is top-level route
var { router } = this.context;
var router = this.context.router
//console.log(router.getCurrentParams())
if ( router.getCurrentRoutes()[childDepth] ) {
var key = router.getCurrentRoutes()[childDepth].name;
@ -240,7 +240,7 @@ if (accounts.length==0) { @@ -240,7 +240,7 @@ if (accounts.length==0) {
}
});
Twister.loadServerAccounts(function(){
Twister.importClientSideAccount("pampalulu","L12kz6tabDN6VmPes1rfEpiznztPF6vgkHp8UZVBgZadxzebHhAp",function(){
var activeAccount = localStorage.getItem("twister-react-activeAccount");
@ -1888,7 +1888,7 @@ var ReactBootstrap = require('react-bootstrap') @@ -1888,7 +1888,7 @@ var ReactBootstrap = require('react-bootstrap')
var React = require('react');
var Router = require('react-router');
var { Route, DefaultRoute, RouteHandler, Link } = Router;
var Route = Router.Route; var DefaultRoute = Router.DefaultRoute; var RouteHandler = Router.RouteHandler; var Link = Router.Link;
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
@ -1901,7 +1901,7 @@ module.exports = Post = React.createClass({displayName: "Post", @@ -1901,7 +1901,7 @@ module.exports = Post = React.createClass({displayName: "Post",
},
getHandlerKey: function () {
var childDepth = 2; // assuming App is top-level route
var { router } = this.context;
var router = this.context.router;
//console.log(router.getCurrentParams())
if ( router.getCurrentRoutes()[childDepth] ) {
var key = router.getCurrentRoutes()[childDepth].name;

4
jsx/App.js

@ -26,7 +26,7 @@ var ReactBootstrap = require('react-bootstrap') @@ -26,7 +26,7 @@ var ReactBootstrap = require('react-bootstrap')
var React = require('react');
var Router = require('react-router');
var { Route, DefaultRoute, RouteHandler, Link } = Router;
var Route = Router.Route; var DefaultRoute = Router.DefaultRoute; var RouteHandler = Router.RouteHandler; var Link = Router.Link;
var Home = require("./home/Home.js");
var Profile = require("./profile/Profile.js");
@ -50,7 +50,7 @@ App = React.createClass({ @@ -50,7 +50,7 @@ App = React.createClass({
getHandlerKey: function () {
var childDepth = 1; // assuming App is top-level route
var { router } = this.context;
var router = this.context.router
//console.log(router.getCurrentParams())
if ( router.getCurrentRoutes()[childDepth] ) {
var key = router.getCurrentRoutes()[childDepth].name;

4
jsx/profile/Profile.js

@ -13,7 +13,7 @@ var ReactBootstrap = require('react-bootstrap') @@ -13,7 +13,7 @@ var ReactBootstrap = require('react-bootstrap')
var React = require('react');
var Router = require('react-router');
var { Route, DefaultRoute, RouteHandler, Link } = Router;
var Route = Router.Route; var DefaultRoute = Router.DefaultRoute; var RouteHandler = Router.RouteHandler; var Link = Router.Link;
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
@ -26,7 +26,7 @@ module.exports = Post = React.createClass({ @@ -26,7 +26,7 @@ module.exports = Post = React.createClass({
},
getHandlerKey: function () {
var childDepth = 2; // assuming App is top-level route
var { router } = this.context;
var router = this.context.router;
//console.log(router.getCurrentParams())
if ( router.getCurrentRoutes()[childDepth] ) {
var key = router.getCurrentRoutes()[childDepth].name;

Loading…
Cancel
Save