This repository was archived by the owner on Jul 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +38
-5
lines changed Expand file tree Collapse file tree 7 files changed +38
-5
lines changed Original file line number Diff line number Diff line change 1+ .active {
2+ color : chartreuse;
3+ }
Original file line number Diff line number Diff line change 11<!doctype html public "storage">
22< html >
33< meta charset =utf-8/ >
4+ < link rel ="stylesheet " href ="index.css " />
45< title > My First React Router App</ title >
56< div id =app > </ div >
67< script src ="bundle.js "> </ script >
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ import App from './modules/App'
44import { Router , Route , hashHistory } from 'react-router'
55import About from './modules/About'
66import Repos from './modules/Repos'
7-
7+ import Repo from './modules/Repo'
88
99render ( (
1010 < Router history = { hashHistory } >
1111 < Route path = "/" component = { App } >
1212 < Route path = "/repos" component = { Repos } />
13+ < Route path = "/repos/:userName/:repoName" component = { Repo } />
1314 < Route path = "/about" component = { About } />
1415 </ Route >
1516 </ Router >
Original file line number Diff line number Diff line change 11import React from 'react'
2- import { Link } from 'react-router' ;
2+ import NavLink from './NavLink'
33
44export default React . createClass ( {
55 render ( ) {
66 return (
77 < div >
88 < h1 > Ghetto hub issues</ h1 >
99 < ul role = "nav" >
10- < li > < Link to = '/about' activeStyle = { { color : '#c9ce06' } } > About</ Link > </ li >
11- < li > < Link to = '/repos' activeStyle = { { color : 'chartreuse' } } > Repos</ Link > </ li >
10+ < li > < NavLink to = '/about' > About</ NavLink > </ li >
11+ < li > < NavLink to = '/repos' > Repos</ NavLink > </ li >
1212 </ ul >
1313 { this . props . children }
1414 </ div >
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { Link } from 'react-router'
3+
4+ export default React . createClass ( {
5+ render ( ) {
6+ return < Link { ...this . props } alt = "Here I am!" activeClassName = "active" />
7+ }
8+ } )
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+
3+ export default React . createClass ( {
4+ render ( ) {
5+ return (
6+ < div >
7+ < h2 > { this . props . params . repoName } </ h2 >
8+ </ div >
9+ )
10+ }
11+ } )
Original file line number Diff line number Diff line change 11import React from 'react'
2+ import { Link } from 'react-router' ;
23
34export default React . createClass ( {
45 render ( ) {
5- return < div > Repos</ div >
6+ return (
7+ < div >
8+ < h2 > Repos</ h2 >
9+ < ul >
10+ < li > < Link to = '/repos/reactjs/react-router' > React Router</ Link > </ li >
11+ < li > < Link to = '/repos/facebook/react' > React</ Link > </ li >
12+ </ ul >
13+ </ div >
14+ )
615 }
716} )
You can’t perform that action at this time.
0 commit comments