-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
120 additions
and
57 deletions.
There are no files selected for viewing
68 changes: 42 additions & 26 deletions
68
react-components-as-routes-lab-onl01-seng-pt-041320/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
react-components-as-routes-lab-onl01-seng-pt-041320/src/components/Actors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 16 additions & 5 deletions
21
react-components-as-routes-lab-onl01-seng-pt-041320/src/components/Directors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import React from 'react'; | ||
import { directors } from '../data'; | ||
import React from "react"; | ||
import { directors } from "../data"; | ||
|
||
const Directors = () => { | ||
return ( | ||
<div> | ||
{/*{code here}*/} | ||
<h1>Directors Page</h1> | ||
{directors.map((director, index) => ( | ||
<div key={index}> | ||
<h3>Name: {director.name}</h3> | ||
<p> | ||
Movies: | ||
{director.movies.map((movie, index) => ( | ||
<li key={index}>{movie}</li> | ||
))} | ||
</p> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
export default Directors | ||
export default Directors; |
4 changes: 2 additions & 2 deletions
4
react-components-as-routes-lab-onl01-seng-pt-041320/src/components/Home.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 15 additions & 3 deletions
18
react-components-as-routes-lab-onl01-seng-pt-041320/src/components/Movies.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 15 additions & 4 deletions
19
react-components-as-routes-lab-onl01-seng-pt-041320/src/components/NavBar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 15 additions & 13 deletions
28
react-components-as-routes-lab-onl01-seng-pt-041320/src/containers/App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import React from 'react'; | ||
import { | ||
BrowserRouter as Router, | ||
Route | ||
} from 'react-router-dom'; | ||
import NavBar from '../components/NavBar'; | ||
import Home from '../components/Home'; | ||
import Actors from '../components/Actors'; | ||
import Directors from '../components/Directors'; | ||
import Movies from '../components/Movies'; | ||
|
||
import React from "react"; | ||
import { BrowserRouter as Router, Route } from "react-router-dom"; | ||
import NavBar from "../components/NavBar"; | ||
import Home from "../components/Home"; | ||
import Actors from "../components/Actors"; | ||
import Directors from "../components/Directors"; | ||
import Movies from "../components/Movies"; | ||
|
||
const App = (props) => { | ||
return ( | ||
<Router> | ||
{/*{code here}*/} | ||
<div className="app"> | ||
<NavBar /> | ||
<Route exact path="/" component={Home} /> | ||
<Route exact path="/actors" component={Actors} /> | ||
<Route exact path="/directors" component={Directors} /> | ||
<Route exact path="/movies" component={Movies} /> | ||
</div> | ||
</Router> | ||
); | ||
}; | ||
|
||
export default App | ||
export default App; |