Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[header-redesign] - Redesign Header for desktop and mobile #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions src/components/desktopHeader.jsx

This file was deleted.

17 changes: 17 additions & 0 deletions src/components/desktopHeader/desktopHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Link from "next/link";
import Image from "next/image";
import logo from "../../assets/logo.png"

export const DesktopHeader = () => <div className="hidden lg:block ">
<nav
className="w-full flex justify-between items-center bg-[#C5C6C7] h-16"
>
<div className="w-16 ml-10">
<Image className="h-auto" src={logo} alt="logo"/>
</div>
<div className="flex gap-5">
<Link href="/" className="text-lg text-[#1F2833] font-semibold transition duration-200 hover:underline hover:ease-in-out">Home</Link>
<Link href="/movies" className="text-lg mr-10 text-[#1F2833] font-semibold transition duration-200 hover:underline hover:ease-in-out">Movies</Link>
</div>
</nav>
</div>
2 changes: 1 addition & 1 deletion src/components/header.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DesktopHeader } from "./desktopHeader";
import { DesktopHeader } from "./desktopHeader/desktopHeader";
import { MobileHeader } from "./mobileHeader/header";

export const Header = () => <>
Expand Down
2 changes: 1 addition & 1 deletion src/components/mobileHeader/burgerSvg.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const BurgerSvg = () =>
<svg className="w-7 h-7 text-red-50" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
<svg className="w-6 h-6 text-red-50" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
<path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M1 1h15M1 7h15M1 13h15" />
</svg>
4 changes: 2 additions & 2 deletions src/components/mobileHeader/links.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "next/link";
export const Links = () => <div className="flex items-center flex-col gap-5">
<Link href="/" className="w-1/2 bg-slate-900 text-center h-12 flex items-center justify-center" onClick={() => setIsOpen(false)}>Home</Link>
<Link href="/movies" className="w-1/2 bg-slate-900 text-center h-12 flex items-center justify-center" onClick={() => setIsOpen(false)}>Movies</Link>
<Link href="/" className="w-11/12 p-4 text-lg font-semibold text-[#1F2833] hover:bg-[#e3e3e3] hover:text-[#45A29E] rounded" onClick={() => setIsOpen(false)}>Home</Link>
<Link href="/movies" className="w-11/12 p-4 text-lg font-semibold text-[#1F2833] hover:bg-[#e3e3e3] hover:text-[#45A29E] rounded" onClick={() => setIsOpen(false)}>Movies</Link>
</div>
6 changes: 4 additions & 2 deletions src/components/mobileHeader/overlay.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { BurgerSvg, XIconSvg } from "./xIconSvg";
import { XIconSvg } from "./xIconSvg";
import {Links} from "@/components/mobileHeader/links";

export const Overlay = ({ setIsOpen, isOpen }) =>
<div className={`absolute left-0 top-0 h-full bg-[#C5C6C7] w-full ${isOpen ? "block" : "hidden"} z-10`}>
<div className={`absolute left-0 top-0 h-full bg-[#C5C6C7] w-4/6 ${isOpen ? "block" : "hidden"} z-10`}>
<button onClick={() => setIsOpen(false)}>
<XIconSvg />
</button>
<Links />
</div>
2 changes: 1 addition & 1 deletion src/components/mobileHeader/xIconSvg.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const XIconSvg = () =>
<svg viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" className="text-[#1F2833] w-7 h-7 m-5">
<svg viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" className="text-[#1F2833] w-6 h-6 m-5">
<line x1="1" y1="11" x2="11" y2="1" stroke="black" strokeWidth="2"/>
<line x1="1" y1="1" x2="11" y2="11" stroke="black" strokeWidth="2"/>
</svg>