Skip to content

Commit

Permalink
Update the UI view
Browse files Browse the repository at this point in the history
  • Loading branch information
musangamfure committed Jul 1, 2023
1 parent a3ed34c commit 1f71001
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Home() {
return (
<>
<div className="hero">
<div className="title" />
<h1>Shows</h1>
<div className="filter">
<span>Categories</span>
<select onChange={handleCategory}>
Expand Down
54 changes: 33 additions & 21 deletions src/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import '../styles/header.css';
import { Outlet } from 'react-router-dom';
import { useState } from 'react';
import { IoSettingsOutline } from 'react-icons/io5';
import { FaMicrophone } from 'react-icons/fa';

const Header = () => {
const [darkTheme, setDarkTheme] = useState(false);
Expand All @@ -15,27 +17,37 @@ const Header = () => {
<>
<header className="header">
<h1>Movies App</h1>
{darkTheme ? (
<div
className="theme-light hidden"
onClick={handleTheme}
onKeyDown={handleTheme}
role="button"
tabIndex={0}
>
<i className="fa-solid fa-moon" />
</div>
) : (
<div
className="theme-dark"
onClick={handleTheme}
onKeyDown={handleTheme}
role="button"
tabIndex={0}
>
<i className="fa-solid fa-sun" />
</div>
)}
<div className="container">
<ul>
<li>
<IoSettingsOutline />
</li>
<li>
<FaMicrophone />
</li>
</ul>
{darkTheme ? (
<div
className="theme-light hidden"
onClick={handleTheme}
onKeyDown={handleTheme}
role="button"
tabIndex={0}
>
<i className="fa-solid fa-moon" />
</div>
) : (
<div
className="theme-dark"
onClick={handleTheme}
onKeyDown={handleTheme}
role="button"
tabIndex={0}
>
<i className="fa-solid fa-sun" />
</div>
)}
</div>
</header>
<Outlet />
</>
Expand Down
23 changes: 13 additions & 10 deletions src/components/Show.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../styles/Show.css';
import { useNavigate } from 'react-router-dom';
import PropTypes from 'prop-types';
import { BsArrowRightCircle } from 'react-icons/bs';

function Show({ Show }) {
const navigate = useNavigate();
Expand All @@ -12,18 +13,17 @@ function Show({ Show }) {

return (
<div className="show-item">
<button
type="button"
onClick={handleShowDetails}
aria-label="View more info"
className="details-btn"
>
<BsArrowRightCircle />
</button>
<img className="show-image" src={Show.image.medium} alt="" />
<h3 className="show-name">{Show.name}</h3>
<div className="view-more">
<button
type="button"
onClick={handleShowDetails}
aria-label="View more info"
className="details-btn"
>
View Details
</button>
</div>
<h3 className="show-rating">{Show.rating.average}</h3>
</div>
);
}
Expand All @@ -35,6 +35,9 @@ Show.propTypes = {
medium: PropTypes.string.isRequired,
}).isRequired,
name: PropTypes.string.isRequired,
rating: PropTypes.shape({
average: PropTypes.number.isRequired,
}).isRequired,
}).isRequired,
};

Expand Down
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ body {
font-size: 1.4rem;
width: 100%;
height: 100%;
background: var(--dark-mode-bg);
}

.root {
Expand Down
7 changes: 2 additions & 5 deletions src/styles/Home.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
.hero {
height: 20vh;
height: 15vh;
color: var(--light-mode-text);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 2% 10%;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
padding: 0 10px;
}

.hero h1 {
Expand Down
10 changes: 4 additions & 6 deletions src/styles/Show.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
display: flex;
flex-direction: column;
color: var(--light-mode-text);
align-items: flex-start;
align-items: flex-end;
background-color: var(--color-white);
margin-bottom: 3rem;
text-decoration: none;
box-shadow: 5px 5px 10px 0 #dfd5d5;
padding-right: 10px;
}

.show-item,
Expand All @@ -22,13 +23,10 @@
display: block;
width: 100%;
height: 100%;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}

.show-name,
.view-more {
margin: 10px 0;
.show-name {
margin: 5px 0;
padding-left: 5px;
}

Expand Down
17 changes: 17 additions & 0 deletions src/styles/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@
margin-right: 5px;
}

.container {
display: flex;
}

.header ul {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
list-style-type: none;
margin-right: 10px;
}

.header ul li {
margin-right: 10px;
}

/* Media Query for smaller screens */
@media only screen and (max-width: 768px) {
.header {
Expand Down

0 comments on commit 1f71001

Please sign in to comment.