Skip to content

Commit

Permalink
more css
Browse files Browse the repository at this point in the history
  • Loading branch information
lewypopescu committed Aug 5, 2024
1 parent 79dc261 commit 5378379
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 20 deletions.
12 changes: 12 additions & 0 deletions src/components/Cast/Cast.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import { getMovieCredits } from '../../api';
import styles from './Cast.module.css';
import PropTypes from 'prop-types';

const Cast = () => {
const { movieId } = useParams();
Expand Down Expand Up @@ -43,4 +44,15 @@ const Cast = () => {
);
};

Cast.propTypes = {
cast: PropTypes.arrayOf(
PropTypes.shape({
cast_id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
character: PropTypes.string.isRequired,
profile_path: PropTypes.string,
})
),
};

export default Cast;
3 changes: 3 additions & 0 deletions src/components/Home/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
.list {
list-style: none;
padding: 0;
display: flex;
align-items: center;
flex-direction: column-reverse;
}

.item {
Expand Down
26 changes: 13 additions & 13 deletions src/components/MovieDetails/MovieDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ const MovieDetails = () => {
<button onClick={() => window.history.back()} className={styles.button}>
Go back
</button>
<h3 className={styles.additionalInfoTitle}>Additional information</h3>
<ul className={styles.additionalInfoList}>
<li>
<Link to={`/movies/${movieId}/cast`} className={styles.link}>
Cast
</Link>
</li>
<li>
<Link to={`/movies/${movieId}/reviews`} className={styles.link}>
Reviews
</Link>
</li>
</ul>
<img
src={`https://image.tmdb.org/t/p/w500${movie.poster_path}`}
alt={movie.title}
Expand All @@ -43,19 +56,6 @@ const MovieDetails = () => {
<p className={styles.genres}>
{movie.genres.map(genre => genre.name).join(', ')}
</p>
<h3 className={styles.additionalInfoTitle}>Additional information</h3>
<ul className={styles.additionalInfoList}>
<li>
<Link to={`/movies/${movieId}/cast`} className={styles.link}>
Cast
</Link>
</li>
<li>
<Link to={`/movies/${movieId}/reviews`} className={styles.link}>
Reviews
</Link>
</li>
</ul>
</div>
);
};
Expand Down
9 changes: 7 additions & 2 deletions src/components/MovieDetails/MovieDetails.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
font-weight: bold;
}

.button:hover {
background-color: #005bb5;
}

.poster {
width: 300px;
height: auto;
Expand All @@ -29,12 +33,13 @@
font-weight: bold;
color: #003366;
margin-bottom: 10px;
width: 20%;
}

.score {
font-size: 1.2em;
font-weight: bold;
color: #666;
color: #667;
margin-bottom: 20px;
}

Expand All @@ -52,7 +57,7 @@
font-size: 1.2em;
color: #333;
margin-bottom: 20px;
width: 50%;
width: 20%;
}

.additionalInfoList {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Movies/Movies.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

.form {
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: center;
}

.input {
Expand All @@ -19,6 +22,10 @@
.list {
list-style: none;
padding: 0;
display: flex;
align-items: center;
flex-direction: column-reverse;
margin-top: 50px;
}

.item {
Expand Down
16 changes: 13 additions & 3 deletions src/components/Reviews/Reviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@ const Reviews = () => {

if (reviews.length === 0) {
return (
<p className={styles.message}>
We don't have any reviews for this movie.
</p>
<>
<div className={styles.container}>
<button
onClick={() => window.history.back()}
className={styles.button}
>
Go back
</button>
<p className={styles.message}>
We don't have any reviews for this movie.
</p>
</div>
</>
);
}

Expand Down
32 changes: 30 additions & 2 deletions src/components/Reviews/Reviews.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
.container {
max-width: 800px;
margin: 0 auto;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
text-align: center;
}

.button {
background-color: #66b2ff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
margin-bottom: 20px;
font-weight: bold;
}

.list {
list-style: none;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
text-align: center;
width: 40%;
}

.item {
Expand Down Expand Up @@ -37,3 +56,12 @@ p {
.button:hover {
background-color: #005bb5;
}

.message {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
text-align: center;
width: 40%;
}

0 comments on commit 5378379

Please sign in to comment.