From 602a95353c0fe7269b7d53721a66c3b3606e1dc3 Mon Sep 17 00:00:00 2001 From: Oleh Date: Tue, 17 Dec 2024 21:56:40 +0200 Subject: [PATCH] add task solution --- README.md | 2 +- src/App.jsx | 91 +------------------------- src/components/MovieCard/MovieCard.jsx | 36 +++++++++- src/components/MovieList/MovieList.jsx | 9 ++- 4 files changed, 47 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index 27504b37..cd318ff3 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ You are given movies loaded from the API and initial markup. Your task is to: - Install Prettier Extention and use this [VSCode settings](https://mate-academy.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. +- Replace `` with your Github username in the [DEMO LINK](https://1umamaster.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..f974ef72 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,98 +1,13 @@ /* eslint-disable max-len */ import './App.scss'; -// import moviesFromServer from './api/movies.json'; +import { MovieList } from './components/MovieList/MovieList'; +import moviesFromServer from './api/movies.json'; 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 - -
-
-
-
+
diff --git a/src/components/MovieCard/MovieCard.jsx b/src/components/MovieCard/MovieCard.jsx index a1f454f7..9bc8480c 100644 --- a/src/components/MovieCard/MovieCard.jsx +++ b/src/components/MovieCard/MovieCard.jsx @@ -1,3 +1,37 @@ import './MovieCard.scss'; -export const MovieCard = () => <>Put the card here; +export const MovieCard = ({ movie }) => ( + // <> +
+
+
+ Film logo +
+
+ +
+
+
+
+ imdb +
+
+ +
+

+ {movie.title} +

+
+
+ +
+

{movie.description}

+ + + IMDB + +
+
+
+ // +); diff --git a/src/components/MovieList/MovieList.jsx b/src/components/MovieList/MovieList.jsx index b2820479..1c5937a4 100644 --- a/src/components/MovieList/MovieList.jsx +++ b/src/components/MovieList/MovieList.jsx @@ -1,3 +1,10 @@ import './MovieList.scss'; +import { MovieCard } from '../MovieCard/MovieCard'; -export const MovieList = () => <>Put the list here; +export const MovieList = ({ movies }) => ( +
+ {movies.map(movie => ( + + ))} +
+);