Browse Source

upgrade to react-router 2.0 WIP

master
Julian Steinwachs 9 years ago
parent
commit
0deca79bc3
  1. 38
      jsx/App.js
  2. 5
      jsx/profile/Profile.js

38
jsx/App.js

@ -239,11 +239,7 @@ App = React.createClass({
</DropdownButton> </DropdownButton>
</ButtonGroup> </ButtonGroup>
<br/> <br/>
<RouteHandler {this.props.children}
accounts={this.state.accounts}
activeAccount={this.state.activeAccount}
key={this.getHandlerKey()}
/>
</Col> </Col>
</Row> </Row>
</Grid> </Grid>
@ -258,24 +254,24 @@ initializeApp = function () {
ReactDOM.render(( ReactDOM.render((
<Router history={hashHistory}> <Router history={hashHistory}>
<Route component={App} path="/"> <Route component={App} path="/">
<IndexRoute name="home" component={Home} /> <IndexRoute component={Home} />
<Route name="profile-active" path="/profile" component={Profile}> <Route path="/profile" component={Profile}>
<IndexRoute name="profile-active-timeline-default" component={Timeline} /> <IndexRoute component={Timeline} />
<Route name="profile-active-timeline" path="timeline" component={Timeline} /> <Route path="timeline" component={Timeline} />
<Route name="profile-active-followings" path="followings" component={Followings} /> <Route path="followings" component={Followings} />
<Route name="profile-active-mentions" path="mentions" component={Mentions} /> <Route path="mentions" component={Mentions} />
</Route> </Route>
<Route name="profile" path="/profile/:username" component={Profile}> <Route path="/profile/:username" component={Profile}>
<IndexRoute name="profile-timeline-default" component={Timeline} /> <IndexRoute component={Timeline} />
<Route name="profile-timeline" path="timeline" component={Timeline} /> <Route path="timeline" component={Timeline} />
<Route name="profile-followings" path="followings" component={Followings} /> <Route path="followings" component={Followings} />
<Route name="profile-mentions" path="mentions" component={Mentions} /> <Route path="mentions" component={Mentions} />
</Route> </Route>
<Route name="conversation" path="/conversation/:username/:postid" component={Conversation}/> <Route path="/conversation/:username/:postid" component={Conversation}/>
<Route name="hashtag" path="/hashtag/:hashtag" component={Hashtag}/> <Route path="/hashtag/:hashtag" component={Hashtag}/>
<Route name="settings" path="/settings" component={Settings}/> <Route path="/settings" component={Settings}/>
<Route name="accounts" path="/accounts" component={Accounts}/> <Route path="/accounts" component={Accounts}/>
<Route name="featured" path="/featured" component={Featured}/> <Route path="/featured" component={Featured}/>
</Route> </Route>
</Router> </Router>
), document.getElementById('content')); ), document.getElementById('content'));

5
jsx/profile/Profile.js

@ -91,10 +91,7 @@ module.exports = Post = React.createClass({
<Button href={routeprefix+"mentions"} bsStyle={subroute.indexOf("mentions")>-1 ? "primary" : "default"}><Glyphicon glyph="comment"/></Button> <Button href={routeprefix+"mentions"} bsStyle={subroute.indexOf("mentions")>-1 ? "primary" : "default"}><Glyphicon glyph="comment"/></Button>
</ButtonGroup> </ButtonGroup>
</ListGroupItem> </ListGroupItem>
<RouteHandler {this.props.children}
activeAccount={this.props.activeAccount}
key={this.getHandlerKey()}
/>
</ListGroup> </ListGroup>
); );
} }

Loading…
Cancel
Save