Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
height: 5rem;
background-color: #044599;
padding: 0 10%;
text-align: center;
}

.header nav {
Expand Down
10 changes: 9 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import './App.css';
import { fetchCat, fetchYe } from './service';
import Cats from './pages/cats';
import Quote from './pages/quote';
import About from './pages/About';

class App extends React.Component {
constructor() {
Expand All @@ -23,11 +24,12 @@ class App extends React.Component {
});
}

getQuote = () => {
getQuote = () => {
return fetchYe().then(data => {
let quote = data.quote;
this.setState({quote: quote, picUrl: 'https://picsum.photos/600/600?grayscale'});
});

}

render() {
Expand All @@ -42,6 +44,9 @@ class App extends React.Component {
<li>
<Link to="/quotes">The only direction</Link>
</li>
<li>
<Link to="/about">About this thing</Link>
</li>
</ul>
</nav>
</header>
Expand All @@ -52,6 +57,9 @@ class App extends React.Component {
<Route path="/cats">
<Cats getCat={this.getCat} cat={this.state.cat} />
</Route>
<Route path="/about">
<About />
</Route>
</main>

</div>
Expand Down
9 changes: 9 additions & 0 deletions src/pages/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

const About = () => {
return(
<div>This is new</div>
);
}

export default About;
6 changes: 6 additions & 0 deletions src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ export function fetchYe() {
}).then(response => response.json());
}

// export function fetchNasa() {
// return fetch('https://api.nasa.gov/planetary/apod?api_key=fLyqTkOiS1CYt44RynV69I0bhbx43Kcicjp43jhf', {
// method: 'GET'
// }).then(response => response.json());
// }