diff --git a/devnotes.md b/devnotes.md index 2fdab42..dc8fe4c 100644 --- a/devnotes.md +++ b/devnotes.md @@ -1,2 +1,6 @@ ### Version 1 -On this launch the app contains a search bar, very much like pics-fetching-app (https://github.com/yunusparvezkhan.pics-fetching-app). When user submits a search request, the app requests videos from youtube video api v3 and maps them on the screen. When any video title/thumbnail is clicked, a new section emerges from top containing a youtube video player, the video title, channel name, video description. Folks can use this app on their local environment to avoid ads, as CORS policy blocks the ads. \ No newline at end of file +On this launch the app contains a search bar, very much like pics-fetching-app (https://github.com/yunusparvezkhan.pics-fetching-app). When user submits a search request, the app requests videos from youtube video api v3 and maps them on the screen. When any video title/thumbnail is clicked, a new section emerges from top containing a youtube video player, the video title, channel name, video description. Folks can use this app on their local environment to avoid ads, as CORS policy blocks the ads. + +## Version 1.1 +On this launch the max number of results is increased to 50. That means now new searches will get back 50 results from the YouTube API. However it is important to note that it is not neccessary that 50 video will render on each time, because search results contains other types than videos, which are filtered out in this app, hence the video results depends on the search. +A new functionality also has been added to the app such that whenever a thumbnail or title is clicked, the window scrolls back to top. \ No newline at end of file diff --git a/src/App.js b/src/App.js index ea0c44c..66fa9d8 100644 --- a/src/App.js +++ b/src/App.js @@ -24,8 +24,11 @@ export default class App extends Component { onVideoSelect = (video) => { this.setState({ selectedVideo: video }) + window.scrollTo(0, 0) } + + render() { return (
diff --git a/src/api/youtube-api.js b/src/api/youtube-api.js index df08e2a..764d8cc 100644 --- a/src/api/youtube-api.js +++ b/src/api/youtube-api.js @@ -5,7 +5,7 @@ export default axios.create({ baseURL: "https://www.googleapis.com/youtube/v3", params: { part: "snippet", - maxResults: 5, + maxResults: 50, key: KEY } }) \ No newline at end of file