Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review version(1.0) #7

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Changes from 7 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d350e7f
Project Str
mahmodlte Jun 22, 2020
6eb12c6
added react bootstrap
mahmodlte Jun 22, 2020
bdcfbec
comp
mahmodlte Jun 22, 2020
bff1bf7
adding main
shadan72 Jun 22, 2020
49f77fe
fixing main part
shadan72 Jun 23, 2020
664fe86
first version of navbar component
mahmodlte Jun 24, 2020
1061907
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
mahmodlte Jun 24, 2020
13b6978
first version of navbar
mahmodlte Jun 24, 2020
29d3970
removed react stater files
mahmodlte Jun 24, 2020
5d883c4
jason
AhmadDuhoki Jun 24, 2020
ea1df7d
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
AhmadDuhoki Jun 24, 2020
6a08d86
changed to useState hook
mahmodlte Jun 24, 2020
158339f
did small changes
mahmodlte Jun 24, 2020
63f6b40
updated the onChange event
mahmodlte Jun 24, 2020
53b0608
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
AhmadDuhoki Jun 24, 2020
cc01297
in class work
mahmodlte Jun 25, 2020
067d28a
added spinner
mahmodlte Jun 25, 2020
da3aadc
Merge branch 'master' into development
mahmodlte Jun 25, 2020
43c6bd6
Spinner done
mahmodlte Jun 25, 2020
3d1aade
optmized code
mahmodlte Jun 26, 2020
288891e
learning to pass fetch data to other comps
mahmodlte Jun 26, 2020
c8e0581
some changes
AhmadDuhoki Jun 26, 2020
ac1c3ab
AhmadDuhoki Jun 26, 2020
0bec107
add app.js
Zainab6 Jun 27, 2020
cdba504
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
AhmadDuhoki Jun 27, 2020
336be77
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
mahmodlte Jun 27, 2020
170d1e1
fetch fixed
mahmodlte Jun 27, 2020
ee612f0
handleQuery done
mahmodlte Jun 27, 2020
581ea7b
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
mahmodlte Jun 27, 2020
f0881b0
add app.js
AhmadDuhoki Jun 27, 2020
1be5412
fixed merge conflicts
AhmadDuhoki Jun 27, 2020
7eb3e9e
fixing app component
shadan72 Jun 27, 2020
ddcf430
made some changes
mahmodlte Jun 27, 2020
6e83cf7
Merge branch 'master' of https://github.com/AhmadDuhoki/iraq-bc-movie…
mahmodlte Jun 27, 2020
ddf5892
MoviesGrid and MovieItem is done
mahmodlte Jun 28, 2020
77a04b8
code improvement
mahmodlte Jun 28, 2020
e3de473
fixed the image show of the grids
AhmadDuhoki Jun 28, 2020
51d1ffa
fixed
AhmadDuhoki Jul 4, 2020
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
38 changes: 0 additions & 38 deletions react-assissans/src/App.css

This file was deleted.

26 changes: 0 additions & 26 deletions react-assissans/src/App.js

This file was deleted.

9 changes: 0 additions & 9 deletions react-assissans/src/App.test.js

This file was deleted.

6 changes: 6 additions & 0 deletions react-assissans/src/components/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';

export default function Main(){
return <div>This is main</div>

}
63 changes: 53 additions & 10 deletions react-assissans/src/components/navbar.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
import React from "react";
import { Navbar } from "react-bootstrap";
import { Navbar, Nav } from "react-bootstrap";
import React, { Component } from "react";
class navBar extends Component {
constructor(props) {
super(props);
this.state = {
movieSearch: "",
};
}
handleMovieSearch = (event) => {
this.setState({
movieSearch: event.target.value,
});
};
handleSubmit = (event) => {
event.preventDefault();
moviesData(this.state.movieSearch);
};
render() {
return (
<>
<Navbar bg="dark">
<Navbar.Brand href="#">Assassins Movies</Navbar.Brand>

export default function navBar() {
return (
<>
<Navbar bg="dark" expand="lg">
<Navbar.Brand href="#">Movies</Navbar.Brand>
</Navbar>
</>
);
<Nav>
<Nav.Link href="#home">Home</Nav.Link>
</Nav>
<form className="form-inline my-2" onSubmit={this.handleSubmit}>
<input
className="form-control"
type="search"
placeholder="Search for a Movie"
value={this.state.movieSearch}
onChange={this.handleMovieSearch}
></input>
<button type="submit">Search</button>
</form>
</Navbar>
</>
);
}
}
//function SearchBox() {
// return <></>;
//}
export default navBar;

function moviesData(Searchquery) {
fetch(
`https://api.themoviedb.org/3/search/movie/?api_key=1d54e327869a62aba4dc1b58c2b30233&query=${Searchquery}`
)
.then((movies) => movies.json())
.then((movieData) => console.log(movieData.results));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the fetch working? because in the demo it's not.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Mustafa for the comments, i fixed all except the demo one cause it is working in the vscode but there are some issues in the github page.

moviesData();
5 changes: 3 additions & 2 deletions react-assissans/src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import Navbar from "./components/navbar";

import "bootstrap/dist/css/bootstrap.min.css";
import Main from "./components/main";
ReactDOM.render(
<React.StrictMode>
<Navbar />
<Main />
</React.StrictMode>,
document.getElementById("root")
);
7 changes: 0 additions & 7 deletions react-assissans/src/logo.svg

This file was deleted.