-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from klaryon/feature/navBarComponent
Feature/nav bar component
- Loading branch information
Showing
9 changed files
with
130 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
import { BadgeCheckIcon, CollectionIcon, HomeIcon, LightningBoltIcon, SearchIcon, UserIcon } from "@heroicons/react/outline" | ||
import Image from "next/image" | ||
import HeaderItem from "./HeaderItem" | ||
import { | ||
BadgeCheckIcon, | ||
CollectionIcon, | ||
HomeIcon, | ||
LightningBoltIcon, | ||
SearchIcon, | ||
UserIcon, | ||
} from "@heroicons/react/outline"; | ||
import Image from "next/image"; | ||
import HeaderItem from "./HeaderItem"; | ||
|
||
const Header = () => { | ||
return ( | ||
<header className="flex flex-col sm:flex-row m-5 justify-between items-center h-auto"> | ||
<div className="flex flex-grow justify-evenly max-w-2xl"> | ||
<HeaderItem title="HOME" Icon={HomeIcon} /> | ||
<HeaderItem title="TRENDING" Icon={LightningBoltIcon} /> | ||
<HeaderItem title="VERIFIED" Icon={BadgeCheckIcon} /> | ||
<HeaderItem title="COLLECTIONS" Icon={CollectionIcon} /> | ||
<HeaderItem title="SEARCH" Icon={SearchIcon} /> | ||
<HeaderItem title="ACCOUNT" Icon={UserIcon} /> | ||
</div> | ||
<Image | ||
className="object-contain" | ||
src="https://links.papareact.com/ua6" width={200} height={100} /> | ||
</header> | ||
) | ||
} | ||
return ( | ||
<header className="flex flex-col sm:flex-row m-5 justify-between items-center h-auto"> | ||
<div className="flex flex-grow justify-evenly max-w-2xl"> | ||
<HeaderItem title="HOME" Icon={HomeIcon} /> | ||
<HeaderItem title="TRENDING" Icon={LightningBoltIcon} /> | ||
<HeaderItem title="VERIFIED" Icon={BadgeCheckIcon} /> | ||
<HeaderItem title="COLLECTIONS" Icon={CollectionIcon} /> | ||
<HeaderItem title="SEARCH" Icon={SearchIcon} /> | ||
<HeaderItem title="ACCOUNT" Icon={UserIcon} /> | ||
</div> | ||
<Image | ||
className="object-contain" | ||
src="https://links.papareact.com/ua6" | ||
width={200} | ||
height={100} | ||
/> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header | ||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
const HeaderItem = ({Icon, title}) => { | ||
return ( | ||
<div className="flex flex-col items-center cursor-pointer group w-12 sm:w-20 hover:text-white"> | ||
<Icon className="h-8 mb-1 group-hover:animate-bounce"/> | ||
<p className="opacity-0 group-hover:opacity-100 tracking-widest">{title}</p> | ||
</div> | ||
) | ||
} | ||
const HeaderItem = ({ Icon, title }) => { | ||
return ( | ||
<div className="flex flex-col items-center cursor-pointer group w-12 sm:w-20 hover:text-white"> | ||
<Icon className="h-8 mb-1 group-hover:animate-bounce" /> | ||
<p className="opacity-0 group-hover:opacity-100 tracking-widest"> | ||
{title} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeaderItem | ||
export default HeaderItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import requests from "../utils/requests"; | ||
import { useRouter } from "next/router"; | ||
|
||
const Nav = () => { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<nav className="relative"> | ||
<div className="flex px-10 sm:px-20 text-2xl whitespace-nowrap space-x-10 sm:space-x-20 overflow-x-scroll scrollbar-hide"> | ||
{Object.entries(requests).map(([key, { title, url }]) => ( | ||
<h2 | ||
key={key} | ||
onClick={() => router.push(`/?genre=${key}`)} | ||
className="last:pr-24 cursor-pointer transition duration-100 transform hover:scale-125 hover:text-white active:text-red-500" | ||
> | ||
{title} | ||
</h2> | ||
))} | ||
</div> | ||
<div className="absolute top-0 right-0 bg-gradient-to-l from-[#06202A] h-10 w-1/12" /> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default Nav; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
images: { | ||
domains: ["links.papareact.com", "image.tmdb.org"], | ||
}, | ||
}; | ||
images: { | ||
domains: ["links.papareact.com", "image.tmdb.org"], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
module.exports = { | ||
mode:'jit', | ||
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], | ||
mode: "jit", | ||
purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"], | ||
darkMode: false, // or 'media' or 'class' | ||
theme: { | ||
extend: {}, | ||
}, | ||
variants: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} | ||
plugins: [require("tailwind-scrollbar-hide")], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const API_KEY = process.env.API_KEY; | ||
|
||
export default { | ||
fetchTrending: { | ||
title: "Trending", | ||
url: `/trending/all/week?api_key=${API_KEY}&language=en-US`, | ||
}, | ||
fetchTopRated: { | ||
title: "Top Rated", | ||
url: `/movie/top_rated?api_key=${API_KEY}&language=en-US`, | ||
}, | ||
fetchActionMovies: { | ||
title: "Action", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=28`, | ||
}, | ||
fetchComedyMovies: { | ||
title: "Comedy", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=35`, | ||
}, | ||
fetchHorrorMovies: { | ||
title: "Horror", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=27`, | ||
}, | ||
fetchRomanceMovies: { | ||
title: "Romance", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=10749`, | ||
}, | ||
fetchMystery: { | ||
title: "Mystery", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=9648`, | ||
}, | ||
fetchSciFi: { | ||
title: "Sci-Fi", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=878`, | ||
}, | ||
fetchWestern: { | ||
title: "Western", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=37`, | ||
}, | ||
fetchAnimation: { | ||
title: "Animation", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=16`, | ||
}, | ||
fetchTV: { | ||
title: "TV Movie", | ||
url: `/discover/movie?api_key=${API_KEY}&with_genres=10770`, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters