Skip to content

Commit

Permalink
Done.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreopelle committed Oct 24, 2018
1 parent 9ba4ae8 commit dfdfafa
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/components/Actors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { actors } from '../data';
const Actors = () => {
return (
<div>
{/*{code here}*/}
<h1>Actors Page</h1>
{actors.map((actor, i) =>
<div key={i}>
<h2>Name: {actor.name}</h2>
<p>Movies:</p>
<ul>{actor.movies.map((movie, i) => <li key={i}>{movie}</li>)}</ul>
</div>
)}
</div>
);
};
Expand Down
9 changes: 8 additions & 1 deletion src/components/Directors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { directors } from '../data';
const Directors = () => {
return (
<div>
{/*{code here}*/}
<h1>Directors Page</h1>
{directors.map((director, i) =>
<div key={i}>
<h2>Name: {director.name}</h2>
<p>Movies:</p>
<ul>{director.movies.map((movie, i) => <li key={i}>{movie}</li>)}</ul>
</div>
)}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
const Home = () => {
return (
<div>
{/*{code here}*/}
<h1>Home Page</h1>
</div>
);
};
Expand Down
11 changes: 10 additions & 1 deletion src/components/Movies.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import React from 'react';
import { movies } from '../data';


const Movies = () => {
return (
<div>
{/*{code here}*/}
<h1>Movies Page</h1>
{movies.map((movie, i) =>
<div key={i}>
<h2>Name: {movie.title}</h2>
<p>Time: {movie.time}</p>
<p>Genres:</p>
<ul>{movie.genres.map((genre, i) => <li key={i}>{genre}</li>)}</ul>
</div>
)}
</div>
);
};
Expand Down
9 changes: 7 additions & 2 deletions src/components/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import { NavLink } from 'react-router-dom';

const NavBar = () => {
return (
<div>
{/*{code here}*/}
<div className="navbar">
<ul>
<li><NavLink to="/" exact>Home</NavLink></li>
<li><NavLink to="/movies" exact>Movies</NavLink></li>
<li><NavLink to="/directors" exact>Directors</NavLink></li>
<li><NavLink to="/actors" exact>Actors</NavLink></li>
</ul>
</div>
);
};
Expand Down
8 changes: 7 additions & 1 deletion src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ import Movies from '../components/Movies';
const App = (props) => {
return (
<Router>
{/*{code here}*/}
<div>
<NavBar />
<Route exact path="/" component={Home} />
<Route exact path="/movies" component={Movies} />
<Route exact path="/directors" component={Directors} />
<Route exact path="/actors" component={Actors} />
</div>
</Router>
);
};
Expand Down

0 comments on commit dfdfafa

Please sign in to comment.