Skip to content
Merged
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
43 changes: 43 additions & 0 deletions MovieSearch/927tanmay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

App is deployed at heroku : https://dashboard.heroku.com/apps/moviesearchreact/deploy/github



13,532 changes: 13,532 additions & 0 deletions MovieSearch/927tanmay/package-lock.json

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions MovieSearch/927tanmay/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "movie",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"redux": "^4.0.4",
"redux-devtools-extension": "^2.13.8",
"redux-promise": "^0.6.0",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added MovieSearch/927tanmay/public/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions MovieSearch/927tanmay/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="logo192.png" />

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link
href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin="anonymous"
/>

<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

<div style="background-color:#00caff61" id="root"></div>

</body>
</html>
Binary file added MovieSearch/927tanmay/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MovieSearch/927tanmay/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions MovieSearch/927tanmay/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
2 changes: 2 additions & 0 deletions MovieSearch/927tanmay/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
3 changes: 3 additions & 0 deletions MovieSearch/927tanmay/src/ApiKey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports{
Api_Url: 'http://www.omdbapi.com/?i=tt3896198&apikey=35069641'
}
23 changes: 23 additions & 0 deletions MovieSearch/927tanmay/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#movies img,
#movie img {
width: 100%;
}
.brand-text {
font-size: 2rem;
}
#react-logo {
color: #00d8ff;
}
#imdb-logo {
color: #f5de50;
}
@media (min-width: 960px) {
#movies .col-md-3 .well {
height: 390px;
}

#movies .col-md-3 img {
height: 240px;
}
}

22 changes: 22 additions & 0 deletions MovieSearch/927tanmay/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Main from './components/Main';
import {connect} from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from './redux/action';
import {withRouter} from 'react-router';

function mapStateToProps(state){
return{
text:state.movies.text,
loading:state.movies.loading,
movies:state.movies.movies,
movie:state.movies.movie
}
}

function mapDispatchToProps(dispatch){
return bindActionCreators(actions,dispatch);
}

const App = withRouter(connect(mapStateToProps,mapDispatchToProps)(Main));

export default App;
9 changes: 9 additions & 0 deletions MovieSearch/927tanmay/src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
38 changes: 38 additions & 0 deletions MovieSearch/927tanmay/src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React,{Component} from 'react';

class Footer extends Component{
render(){
return (

<div >
<div className="row">
<div className="col-md-12">
<div className="footer p-3 mt-4 text-center bg-dark text-light">
Developed By:
<span className="text-warning font-weight-normal">
Tanmay Sharma
</span>
, Using <i className="fab fa-react" /> React JS &amp; Redux JS
integrated with external movies data API
<a
href="http://www.omdbapi.com/"
target="_blank"
rel="noopener noreferrer"
>
OMDB
</a>
</div>
</div>
</div>



</div>

);

}

}

export default Footer;
36 changes: 36 additions & 0 deletions MovieSearch/927tanmay/src/components/Main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React,{Component} from 'react';
import Navbar from './Navbar';
import Landing from './landing';
import Footer from './Footer';
import {Route} from 'react-router-dom';
import Single from './singlemovie';

class Main extends Component{
render(){
return(
<div>
<Navbar/>

<Route exact path="/" render={()=>(
<div>
<Landing {...this.props}/>
</div>
)}/>

<Route path='/movie/:id' render={(params)=>(
<div>
<Single {...this.props} {...params}/>
</div>

)}/>



<Footer/>

</div>
)
}
}

export default Main;
26 changes: 26 additions & 0 deletions MovieSearch/927tanmay/src/components/MovieCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, { Component } from 'react'
import {Link} from 'react-router-dom';

export class MovieCard extends Component {
render() {
const {movie}=this.props;
return (

<div className="col-md-3 mb-5">
<div className="card card-body bg-dark text-center h-100">
<img className="w-100 mb-2" src={movie.Poster} alt="Movie Cover" />
<h5 className="text-light card-title">
{movie.Title} - {movie.Year}
</h5>
<Link className="btn btn-primary" to={`/movie/${movie.imdbID}`}>
Movie Details
<i className="fas fa-chevron-right" />
</Link>
</div>
</div>
)
}
}


export default MovieCard;
30 changes: 30 additions & 0 deletions MovieSearch/927tanmay/src/components/MoviesContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, { Component } from 'react';
import MovieCard from './MovieCard';
export class MoviesContainer extends Component {
constructor(props)
{
super(props);
this.state={
content: ""
}
}
componentDidMount()
{
const {movies} =this.props;
this.setState({content : movies.Response==='True'?movies.Search.map((movie,index)=>
<MovieCard key={index} movie={movie}/>): null});
}
componentDidUpdate()
{
if(this.props.movies.Response==="False") window.alert("No such movie exists");
}
render() {
return (
<div className="row">
{this.state.content}
</div>
)
}
}

export default MoviesContainer;
40 changes: 40 additions & 0 deletions MovieSearch/927tanmay/src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

import React,{Component} from 'react';
import {Link} from 'react-router-dom';

class Navbar extends Component{
render(){
return (

<div>
<div>
<nav className="navbar navbar-light bg-dark mb-5">
<div className="container">
<div className="navbar-header">
<Link className="navbar-brand text-white text-lg brand-text" to="/">
MovieSeriesInfo
</Link>
</div>
<ul className="navbar-nav ml-auto text-light d-inline-block">
<li className="nav-item d-inline-block mr-4">
<i className="fab fa-imdb fa-5x" id="imdb-logo"/>
</li>
<li className="nav-item d-inline-block mr-4">
<i className="fab fa-react fa-5x" id="react-logo" />
</li>
</ul>
</div>
</nav>
</div>



</div>

);

}

}

export default Navbar;
Loading