Skip to content

Commit

Permalink
added a container and series list dir
Browse files Browse the repository at this point in the history
  • Loading branch information
marvtdawson committed Sep 20, 2019
1 parent e988c90 commit 8d0db4d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ import React, { Component } from 'react';
import './App.css';
import Index from "../Portfolio";
import Intro from "../Intro";
import Series from "../../containers/Series";
import 'whatwg-fetch';


class App extends Component {
state = {
series: []
}

componentDidMount() {
fetch('http://api.tvmaze.com/search/shows?q=NCIS')
.then((response) => response.json())
.then(json => this.setState({series: json }))
}



render() {
return (
Expand All @@ -24,7 +19,8 @@ class App extends Component {
</header>
<Intro message="Here you can find my most recent works"/>
<Index />
I have {this.state.series.length} favorite TV Series!

<Series />
</div>
);
}
Expand Down
Empty file.
24 changes: 24 additions & 0 deletions src/containers/Series/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React, {Component} from "react";

class Series extends Component {

state = {
series: []
};

componentDidMount() {
fetch('http://api.tvmaze.com/search/shows?q=NCIS')
.then((response) => response.json())
.then(json => this.setState({series: json }))
}
render() {
return (
<div>
I have {this.state.series.length} favorite TV Series!
</div>
)
}

}

export default Series;

0 comments on commit 8d0db4d

Please sign in to comment.