Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 11070b7

Browse files
fetch-movie-app #11
1 parent 2402930 commit 11070b7

File tree

17 files changed

+26959
-1
lines changed

17 files changed

+26959
-1
lines changed

fetch-movies-react-web-app-project/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
![under_construction](https://user-images.githubusercontent.com/37651620/93677983-a7942e00-facc-11ea-8b6d-b57e73dc73bf.png)
1+
![fetch_movies](https://user-images.githubusercontent.com/37651620/95007974-4b391e80-0635-11eb-91fb-040e6b55bfcf.png)
2+
3+
## It's Live 🎉 Visit here ==>https://fetch-movies.netlify.app/
24

35
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
46

fetch-movies-react-web-app-project/package-lock.json

Lines changed: 15823 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "fetch-movies-react-web-app-project",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^4.2.4",
7+
"@testing-library/react": "^9.3.2",
8+
"@testing-library/user-event": "^7.1.2",
9+
"axios": "^0.20.0",
10+
"react": "^16.13.1",
11+
"react-dom": "^16.13.1",
12+
"react-scripts": "3.4.3"
13+
},
14+
"scripts": {
15+
"start": "react-scripts start",
16+
"build": "react-scripts build",
17+
"test": "react-scripts test",
18+
"eject": "react-scripts eject"
19+
},
20+
"eslintConfig": {
21+
"extends": "react-app"
22+
},
23+
"browserslist": {
24+
"production": [
25+
">0.2%",
26+
"not dead",
27+
"not op_mini all"
28+
],
29+
"development": [
30+
"last 1 chrome version",
31+
"last 1 firefox version",
32+
"last 1 safari version"
33+
]
34+
}
35+
}
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
14+
15+
<title>Fetch Movies</title>
16+
</head>
17+
<body>
18+
<noscript>You need to enable JavaScript to run this app.</noscript>
19+
<div id="root"></div>
20+
</body>
21+
</html>
5.22 KB
Loading
9.44 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React, { useState } from "react";
2+
import "../styles/App.css";
3+
import Search from "./Search";
4+
import axios from "axios";
5+
import MoviesDisplay from "./MoviesDisplay";
6+
7+
function App() {
8+
const API_KEY = "https://www.omdbapi.com/?i=tt3896198&apikey=ab6efc1d"; // http://www.omdbapi.com/?i=tt3896198&apikey=120bd05f
9+
const [state, setState] = useState({
10+
s: "",
11+
results: [],
12+
selected: {},
13+
});
14+
15+
const search = (e) => {
16+
if (e.key === "Enter") {
17+
axios(API_KEY + "&s=" + state.s).then(({ data }) => {
18+
let results = data.Search;
19+
20+
setState((prevState) => {
21+
return { ...prevState, results: results };
22+
});
23+
});
24+
}
25+
};
26+
27+
const handleInput = (e) => {
28+
let s = e.target.value;
29+
30+
setState((prevState) => {
31+
return { ...prevState, s: s };
32+
});
33+
};
34+
35+
return (
36+
<div className="App">
37+
<header>
38+
<h1>Fetch Movies</h1>
39+
</header>
40+
<main>
41+
<Search handleInput={handleInput} search={search} />
42+
43+
<MoviesDisplay results={state.results} />
44+
</main>
45+
</div>
46+
);
47+
}
48+
49+
export default App;

0 commit comments

Comments
 (0)