Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalvia committed Aug 29, 2021
1 parent cbb2dda commit 3d347ad
Show file tree
Hide file tree
Showing 37 changed files with 16,861 additions and 136 deletions.
16,360 changes: 16,360 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.6.1",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.21.1",
"node-sass": "^6.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"web-vitals": "^1.0.1"
},
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

37 changes: 20 additions & 17 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import logo from './logo.svg';
import './App.css';
import React from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Home from "./components/Home/Home";
import Header from "./components/Header/Header";
import Footer from "./components/Footer/Footer";
import PageNotFound from "./components/PageNotFound/PageNotFound";
import MovieDetail from "./components/MovieDetail/MovieDetail";
import "./App.scss";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div className="app">
<Router>
<Header></Header>
<div className="container">
<Switch>
<Route path="/" exact component={Home} />
<Route path="/movie/:imdbID" component={MovieDetail} />
<Route component={PageNotFound} />
</Switch>
</div>
<Footer />
</Router>
</div>
);
}
Expand Down
18 changes: 18 additions & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import "../src/common/colors.scss";

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Open Sans", sans-serif;
}
a {
text-decoration: none;
}

body {
background: $primary-color;
}
.container {
margin: 0px 40px;
}
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

1 change: 1 addition & 0 deletions src/common/apis/MovieApiKey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const APIKey = "53c800d";
5 changes: 5 additions & 0 deletions src/common/apis/movieApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import axios from "axios";

export default axios.create({
baseURL: "https://www.omdbapi.com",
});
4 changes: 4 additions & 0 deletions src/common/colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$primary-color: #0f171e;
$secondary-color: #1a242f;
$font-primary: #ffffff;
$font-secondary: #79b8f3;
13 changes: 13 additions & 0 deletions src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import "./Footer.scss";

const Footer = () => {
return (
<div className="footer">
<div>Movie App</div>
<div>©2021, Movie, Inc. or its affiliates</div>
</div>
);
};

export default Footer;
10 changes: 10 additions & 0 deletions src/components/Footer/Footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "../../common/colors.scss";
.footer {
background: $secondary-color;
height: 72px;
display: flex;
justify-content: center;
align-items: center;
color: $font-primary;
flex-direction: column;
}
19 changes: 19 additions & 0 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import { Link } from "react-router-dom";
import user from "../../images/user.png";
import "./Header.scss";

const Header = () => {
return (
<div className="header">
<Link to="/">
<div className="logo">Movie App</div>
</Link>
<div className="user-image">
<img src={user} alt="user" />
</div>
</div>
);
};

export default Header;
22 changes: 22 additions & 0 deletions src/components/Header/Header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@import "../../common/colors.scss";

.header {
background-color: $secondary-color;
height: 72px;
padding: 0px 40px;
display: flex;
align-items: center;
justify-content: space-between;
}

.logo {
color: $font-primary;
font-size: 20px;
font-weight: 600;
}

.user-image,
.user-image img {
width: 38px;
height: 38px;
}
23 changes: 23 additions & 0 deletions src/components/Home/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { useEffect } from "react";
import MovieListing from "../MovieListing/MovieListing";

import { useDispatch } from "react-redux";
import {
fetchAsyncMovies,
fetchAsyncShows,
} from "../../features/movies/movieSlice";
const Home = () => {
const dispatch = useDispatch();
useEffect(() => {
dispatch(fetchAsyncMovies());
dispatch(fetchAsyncShows());
}, [dispatch]);
return (
<div>
<div className="banner-img"></div>
<MovieListing />
</div>
);
};

export default Home;
Empty file added src/components/Home/Home.scss
Empty file.
26 changes: 26 additions & 0 deletions src/components/MovieCard/MovieCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { Link } from "react-router-dom";
import "./MovieCard.scss";

const MovieCard = (props) => {
const { data } = props;
return (
<div className="card-item">
<Link to={`/movie/${data.imdbID}`}>
<div className="card-inner">
<div className="card-top">
<img src={data.Poster} alt={data.Title} />
</div>
<div className="card-bottom">
<div className="card-info">
<h4>{data.Title}</h4>
<p>{data.Year}</p>
</div>
</div>
</div>
</Link>
</div>
);
};

export default MovieCard;
32 changes: 32 additions & 0 deletions src/components/MovieCard/MovieCard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@import "../../common/colors.scss";
.card-item {
background: $secondary-color;
cursor: pointer;
transition: all 0.3s;

&:hover {
transform: scale(1.1);
transition: all 0.3s;
}
}

.card-top {
height: 300px;

img {
width: 100%;
height: 100%;
}
}

.card-bottom {
padding: 20px;
}
.card-info {
color: $font-primary;
h4 {
font-size: 22px;
font-weight: 400;
margin-bottom: 10px;
}
}
Loading

0 comments on commit 3d347ad

Please sign in to comment.