-
Notifications
You must be signed in to change notification settings - Fork 3
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 #43 from nnivxix/feat/next-js-2
Feat/next js rebase
- Loading branch information
Showing
50 changed files
with
4,383 additions
and
4,377 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 |
---|---|---|
|
@@ -23,4 +23,8 @@ dist-ssr | |
*.sln | ||
*.sw? | ||
|
||
.env | ||
.env | ||
|
||
.next | ||
next-env.d.ts | ||
build |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React from "react"; | ||
import "../src/index.css"; | ||
import Navbar from "@/components/Navbar"; | ||
import Footer from "@/components/Footer"; | ||
import { Toaster } from "@/components/ui/toaster"; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en" className="dark"> | ||
<head> | ||
<meta charSet="UTF-8" /> | ||
<link | ||
rel="apple-touch-icon" | ||
sizes="180x180" | ||
href="/images/apple-touch-icon.png" | ||
/> | ||
<link | ||
rel="icon" | ||
type="image/png" | ||
sizes="32x32" | ||
href="/images/favicon-32x32.png" | ||
/> | ||
<link | ||
rel="icon" | ||
type="image/png" | ||
sizes="16x16" | ||
href="/images/favicon-16x16.png" | ||
/> | ||
<link rel="manifest" href="/images/site.webmanifest" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link | ||
rel="preload" | ||
fetchPriority="high" | ||
as="image" | ||
href="/poster-fallback.png" | ||
type="image/png" | ||
/> | ||
<link | ||
rel="preload" | ||
fetchPriority="high" | ||
as="image" | ||
href="/backdrop-fallback.png" | ||
type="image/png" | ||
/> | ||
|
||
<title>Vilm</title> | ||
<meta name="description" content="Get movies and tv shows information." /> | ||
<meta property="og:site_name" content="Vilm" /> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:url" content="https://vilm-react.vercel.app/" /> | ||
<meta property="og:title" content="Vilm" /> | ||
<meta | ||
property="og:description" | ||
content="Get movies and tv shows information." | ||
/> | ||
<meta property="og:image" content="/og-image.jpg" /> | ||
|
||
{/* <!-- Twitter --> */} | ||
<meta property="twitter:card" content="summary_large_image" /> | ||
<meta property="twitter:url" content="https://vilm-react.vercel.app/" /> | ||
<meta | ||
property="twitter:title" | ||
content="Get movies and tv shows information." | ||
/> | ||
<meta | ||
property="twitter:description" | ||
content="Get movies and tv shows information." | ||
/> | ||
<meta property="twitter:image" content="/og-image.jpg" /> | ||
<meta name="twitter:creator" content="@nnivxix" /> | ||
</head> | ||
<body> | ||
<Navbar /> | ||
<div id="root">{children}</div> | ||
<Footer /> | ||
<Toaster /> | ||
{/* <script type="module" src="/src/main.tsx"></script> */} | ||
</body> | ||
</html> | ||
); | ||
} |
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,63 @@ | ||
"use client" | ||
import type { FormEvent } from "react"; | ||
import { buttonVariants } from "@/components/ui/button"; | ||
import { cn } from "@/lib/utils"; | ||
import { Suspense, useState } from "react"; | ||
import { Input } from "@/components/ui/input" | ||
import Link from "next/link"; | ||
import { useSearchParams } from "next/navigation"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
function SearchForm() { | ||
const searchParams = useSearchParams(); | ||
const querySearch = searchParams?.get("title"); | ||
const [search, setSearch] = useState<string>(querySearch ?? ""); | ||
const router = useRouter(); | ||
|
||
const handleSearch = (e: FormEvent) => { | ||
e.preventDefault(); | ||
|
||
if (!search.length) { | ||
return; | ||
} | ||
|
||
router.push(`/search?title=${search}&type=movie`); | ||
}; | ||
|
||
return ( | ||
<form onSubmit={handleSearch} className="lg:w-1/2 w-full"> | ||
<Input | ||
type="search" | ||
value={search} | ||
onChange={(e) => setSearch(e.target.value)} | ||
className="rounded-md py-5 w-full focus:outline-none focus:ring-2 focus:ring-gray-700 focus:border-transparent" | ||
aria-label="Search" | ||
placeholder="Search movies and tvs" | ||
style={{ backgroundColor: "#c4c4c430" }} | ||
/> | ||
</form> | ||
); | ||
} | ||
|
||
export default function Page() { | ||
|
||
return ( | ||
<div className="lg:bg-[url('/home-banner.jpg')] bg-[url('/home-banner-vertical.jpg')] bg-center bg-cover" data-bg-src="https://www.pexels.com/photo/three-friends-watching-at-a-movie-theater-while-eating-popcorn-8263318/"> | ||
<div className="mx-auto max-w-4xl px-5 mt-5"> | ||
<div className="flex w-full lg:h-[63vh] h-[45vh] md:h-[56vh] justify-center flex-col gap-3 items-center"> | ||
<div className="text-center"> | ||
<h1 className="text-3xl font-bold italic">Vilm</h1> | ||
<h2 className="text-xl font-bold">Explore what you next watch?</h2> | ||
</div> | ||
<Suspense> | ||
<SearchForm /> | ||
</Suspense> | ||
<p> | ||
Or | ||
</p> | ||
<Link href='/discover' className={`lg:w-1/2 w-full ${cn(buttonVariants({ variant: "default" }))}`}> Discover </Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.