diff --git a/README.md b/README.md index 27504b37..2c471f6d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You are given movies loaded from the API and initial markup. Your task is to: 1. Keep all `data-cy` attributes to pass the tests. ## Instructions -- Install Prettier Extention and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/vscode/settings.json) to enable format on save. +- Install Prettier Extention and use this [VSCode settings](https://DianaKadimbekova.github.io/fe-program/tools/vscode/settings.json) to enable format on save. - Implement a solution following the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline). - Open one more terminal and run tests with `npm test` to ensure your solution is correct. - Replace `` with your Github username in the [DEMO LINK](https://.github.io/react_movies-list-js/) and add it to the PR description. diff --git a/src/App.jsx b/src/App.jsx index f36c45ef..e9ffc629 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,100 +1,14 @@ /* eslint-disable max-len */ import './App.scss'; -// import moviesFromServer from './api/movies.json'; +import moviesFromServer from './api/movies.json'; +import { MovieList } from './components/MovieList/MovieList'; export const App = () => (
-
-
-
-
- Film logo -
-
- -
-
-
-
- imdb -
-
- -
-

- Inception -

-
-
- -
-

- Follows the lives of eight very different couples in dealing - with their love lives in various loosely interrelated tales all - set during a frantic month before Christmas in London, England. -

- - - IMDB - -
-
-
- -
-
-
- Film logo -
-
- -
-
-
-
- imdb -
-
- -
-

- Love Actually -

-
-
- -
-

- A thief who steals corporate secrets through the use of - dream-sharing technology is given the inverse task of planting - an idea into the mind of a C.E.O. -

- - - IMDB - -
-
-
-
+
-
Sidebar will be here
diff --git a/src/App.scss b/src/App.scss index 59cee43b..c2bf582f 100644 --- a/src/App.scss +++ b/src/App.scss @@ -2,28 +2,7 @@ iframe { display: none; } -.page { - display: grid; - grid-template: auto / 1fr 400px; - column-gap: 20px; - min-height: 100vh; -} - -.page-content { - padding: 20px; -} - .sidebar { padding: 20px; border-left: 1px solid lightgray; } - -.movies { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); - gap: 20px; -} - -.card-image img { - object-fit: contain; -} diff --git a/src/components/MovieCard/MovieCard.jsx b/src/components/MovieCard/MovieCard.jsx index a1f454f7..45d760f9 100644 --- a/src/components/MovieCard/MovieCard.jsx +++ b/src/components/MovieCard/MovieCard.jsx @@ -1,3 +1,40 @@ import './MovieCard.scss'; -export const MovieCard = () => <>Put the card here; +export const MovieCard = ({ movie }) => ( +
+
+
+ {`${movie.title} +
+
+ +
+
+
+
+ imdb +
+
+ +
+

+ {movie.title} +

+
+
+ +
+

{movie.description}

+ + + IMDB + +
+
+
+); diff --git a/src/components/MovieCard/MovieCard.scss b/src/components/MovieCard/MovieCard.scss index f1b40ee0..19e71435 100644 --- a/src/components/MovieCard/MovieCard.scss +++ b/src/components/MovieCard/MovieCard.scss @@ -1 +1,11 @@ // add styles here + +.card-image img { + object-fit: contain; +} + +.movies { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 20px; +} diff --git a/src/components/MovieList/MovieList.jsx b/src/components/MovieList/MovieList.jsx index b2820479..09e6a81d 100644 --- a/src/components/MovieList/MovieList.jsx +++ b/src/components/MovieList/MovieList.jsx @@ -1,3 +1,10 @@ +import { MovieCard } from '../MovieCard/MovieCard'; import './MovieList.scss'; -export const MovieList = () => <>Put the list here; +export const MovieList = ({ movies }) => ( +
+ {movies.map(movie => ( + + ))} +
+); diff --git a/src/components/MovieList/MovieList.scss b/src/components/MovieList/MovieList.scss index f1b40ee0..4cfbb0ef 100644 --- a/src/components/MovieList/MovieList.scss +++ b/src/components/MovieList/MovieList.scss @@ -1 +1,11 @@ // add styles here +.page { + display: grid; + grid-template: auto / 1fr 400px; + column-gap: 20px; + min-height: 100vh; +} + +.page-content { + padding: 20px; +}