mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-08-26 13:52:06 +00:00
upgrade to react-router 2.0 WIP
This commit is contained in:
parent
6a0e0a6f04
commit
0deca79bc3
38
jsx/App.js
38
jsx/App.js
@ -239,11 +239,7 @@ App = React.createClass({
|
||||
</DropdownButton>
|
||||
</ButtonGroup>
|
||||
<br/>
|
||||
<RouteHandler
|
||||
accounts={this.state.accounts}
|
||||
activeAccount={this.state.activeAccount}
|
||||
key={this.getHandlerKey()}
|
||||
/>
|
||||
{this.props.children}
|
||||
</Col>
|
||||
</Row>
|
||||
</Grid>
|
||||
@ -258,24 +254,24 @@ initializeApp = function () {
|
||||
ReactDOM.render((
|
||||
<Router history={hashHistory}>
|
||||
<Route component={App} path="/">
|
||||
<IndexRoute name="home" component={Home} />
|
||||
<Route name="profile-active" path="/profile" component={Profile}>
|
||||
<IndexRoute name="profile-active-timeline-default" component={Timeline} />
|
||||
<Route name="profile-active-timeline" path="timeline" component={Timeline} />
|
||||
<Route name="profile-active-followings" path="followings" component={Followings} />
|
||||
<Route name="profile-active-mentions" path="mentions" component={Mentions} />
|
||||
<IndexRoute component={Home} />
|
||||
<Route path="/profile" component={Profile}>
|
||||
<IndexRoute component={Timeline} />
|
||||
<Route path="timeline" component={Timeline} />
|
||||
<Route path="followings" component={Followings} />
|
||||
<Route path="mentions" component={Mentions} />
|
||||
</Route>
|
||||
<Route name="profile" path="/profile/:username" component={Profile}>
|
||||
<IndexRoute name="profile-timeline-default" component={Timeline} />
|
||||
<Route name="profile-timeline" path="timeline" component={Timeline} />
|
||||
<Route name="profile-followings" path="followings" component={Followings} />
|
||||
<Route name="profile-mentions" path="mentions" component={Mentions} />
|
||||
<Route path="/profile/:username" component={Profile}>
|
||||
<IndexRoute component={Timeline} />
|
||||
<Route path="timeline" component={Timeline} />
|
||||
<Route path="followings" component={Followings} />
|
||||
<Route path="mentions" component={Mentions} />
|
||||
</Route>
|
||||
<Route name="conversation" path="/conversation/:username/:postid" component={Conversation}/>
|
||||
<Route name="hashtag" path="/hashtag/:hashtag" component={Hashtag}/>
|
||||
<Route name="settings" path="/settings" component={Settings}/>
|
||||
<Route name="accounts" path="/accounts" component={Accounts}/>
|
||||
<Route name="featured" path="/featured" component={Featured}/>
|
||||
<Route path="/conversation/:username/:postid" component={Conversation}/>
|
||||
<Route path="/hashtag/:hashtag" component={Hashtag}/>
|
||||
<Route path="/settings" component={Settings}/>
|
||||
<Route path="/accounts" component={Accounts}/>
|
||||
<Route path="/featured" component={Featured}/>
|
||||
</Route>
|
||||
</Router>
|
||||
), document.getElementById('content'));
|
||||
|
@ -91,10 +91,7 @@ module.exports = Post = React.createClass({
|
||||
<Button href={routeprefix+"mentions"} bsStyle={subroute.indexOf("mentions")>-1 ? "primary" : "default"}><Glyphicon glyph="comment"/></Button>
|
||||
</ButtonGroup>
|
||||
</ListGroupItem>
|
||||
<RouteHandler
|
||||
activeAccount={this.props.activeAccount}
|
||||
key={this.getHandlerKey()}
|
||||
/>
|
||||
{this.props.children}
|
||||
</ListGroup>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user