From 17da0c96d5f2ce6f91a6c82b9c7bad91a6c69b8d Mon Sep 17 00:00:00 2001 From: real-zephex Date: Sat, 27 Jul 2024 13:43:28 +0530 Subject: feat: removed manga and redirected to the new site, changed the landing page a little bit --- src/app/components/header/header.jsx | 43 +++++++++++++----------- src/app/page.jsx | 63 +++++++++++++----------------------- 2 files changed, 46 insertions(+), 60 deletions(-) diff --git a/src/app/components/header/header.jsx b/src/app/components/header/header.jsx index 6bb362a..2a4bc8d 100644 --- a/src/app/components/header/header.jsx +++ b/src/app/components/header/header.jsx @@ -14,11 +14,19 @@ import { DropdownSection, DropdownItem, } from "@nextui-org/react"; -import { useState } from "react"; +import { useEffect, useState } from "react"; +import { usePathname } from "next/navigation"; export default function Header() { - const sections = ["anime", "kdrama", "movies", "web-series", "manga"]; - const [currentPage, setCurrentPage] = useState("Homepage"); + const path = usePathname(); + const sections = ["anime", "kdrama", "movies", "web-series"]; + const [currentPage, setCurrentPage] = useState(""); + + useEffect(() => { + setCurrentPage( + path.split("/")[1] !== "" ? path.split("/")[1] : "Homepage" + ); + }, [path]); return ( @@ -36,7 +44,7 @@ export default function Header() { {sections && - sections.slice(0, 4).map((item, index) => ( + sections.map((item, index) => ( - {sections && - sections.slice(-1).map((item, index) => ( - - - - ))} + + + diff --git a/src/app/page.jsx b/src/app/page.jsx index 7c8b209..16d447d 100644 --- a/src/app/page.jsx +++ b/src/app/page.jsx @@ -10,36 +10,9 @@ import Image from "next/image"; import Link from "next/link"; export default async function Home() { - const homePageCards = (title, image) => { - return ( - - - - anime image - - - -

{title}

-
-
- - ); - }; - return ( -
-
+
+

Welcome to


Dramalama

@@ -49,21 +22,29 @@ export default async function Home() {

- {/*
-
+
+ anime image -

Anime

-
-
*/} -
- {homePageCards("anime", "todoroki.jpg")} - {homePageCards("manga", "manga.jpg")} + + + +
-- cgit v1.2.3