Permalink
Browse files

Code along up to Movie component

  • Loading branch information...
jmeade11 committed Jan 13, 2020
1 parent 9c562d2 commit 98b0c294774c59a5114c4874ef2aeaa24d8725a5
Showing with 50 additions and 19 deletions.
  1. +1 −1 public/index.html
  2. +11 −18 src/App.js
  3. +21 −0 src/Header.js
  4. +17 −0 src/Welcome.js
@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Movie App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
@@ -1,26 +1,19 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import Header from './Header.js';

const movie = {
title: 'Star Wars: The Rise of Skywalker',
poster: 'https://image.tmdb.org/t/p/w500/db32LaOibwEliAmSL2jjDF6oDdj.jpg',
rotten_tomatoes: 53,
audience_score: 86,
summary:
'The surviving Resistance faces the First Order once again as the journey of Rey, Finn and Poe Dameron continues. With the power and knowledge of generations behind them, the final battle begins.'
};

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
return <Header />;
}

export default App;
@@ -0,0 +1,21 @@
import React from 'react';
import Welcome from './Welcome.js';

// Welcome({ name: 'Joe' })

function Header() {
return (
<header>
<h1>Reelz: The Movie App</h1>
<div>
<ul>
<li>Now Playing</li>
<li>Must See Movies</li>
</ul>
</div>
<Welcome name={'Jen'} newUser={false} />
</header>
);
}

export default Header;
@@ -0,0 +1,17 @@
import React from 'react';

// props = {
// name: 'Jen',
// newUser: true
// }

function Welcome(props) {
const message = props.newUser ? 'Welcome aboard' : 'Welcome back';
return (
<p>
{message}, {props.name}
</p>
);
}

export default Welcome;

0 comments on commit 98b0c29

Please sign in to comment.