👔 create config for routing

This commit is contained in:
2025-08-05 07:05:32 +07:00
parent ed8acbbcb0
commit 9930f27a84
6 changed files with 40 additions and 9 deletions

View File

@ -0,0 +1,7 @@
import React from "react";
const page = () => {
return <div>Genre Page</div>;
};
export default page;

View File

@ -0,0 +1,7 @@
import React from "react";
const page = () => {
return <div>Schedule Page</div>;
};
export default page;

View File

@ -0,0 +1,7 @@
import React from "react";
const page = () => {
return <div>Trending Page</div>;
};
export default page;

9
shared/config/routes.ts Normal file
View File

@ -0,0 +1,9 @@
export const routes = {
home: "/",
login: "/log-in",
signup: "/sign-up",
explore: "/explore",
trending: "/trending",
genres: "/genres",
schedule: "/schedule",
};

View File

@ -14,6 +14,7 @@ import {
import { usePathname, useRouter } from "next/navigation";
import React, { useState } from "react";
import { delayButtonClick } from "../lib/delayButtonClick";
import { routes } from "../config/routes";
export const AcmeLogo = () => {
return (
@ -29,7 +30,6 @@ export const AcmeLogo = () => {
};
const NavbarUI = () => {
const router = useRouter();
const pathNameNow = usePathname();
const [isMenuOpen, setIsMenuOpen] = useState(false);
@ -37,23 +37,23 @@ const NavbarUI = () => {
const navbarItems = [
{
title: "Home",
route: "/",
route: routes.home,
},
{
title: "Explore",
route: "/explore",
route: routes.explore,
},
{
title: "Trending",
route: "/trending",
route: routes.trending,
},
{
title: "Genres",
route: "/genre",
route: routes.genres,
},
{
title: "Schedule",
route: "/schedule",
route: routes.schedule,
},
];
@ -88,7 +88,7 @@ const NavbarUI = () => {
</NavbarContent>
<NavbarContent justify="end">
<NavbarItem className="hidden lg:flex">
<Link href="/login" className="font-medium">
<Link href={routes.login} className="font-medium">
Login
</Link>
</NavbarItem>
@ -98,7 +98,7 @@ const NavbarUI = () => {
variant="solid"
radius="sm"
as={Link}
href="/sign-up"
href={routes.signup}
>
Sign Up
</Button>

View File

@ -4,6 +4,7 @@ import { Card, Divider, Link } from "@heroui/react";
import React from "react";
import EmailForm from "./EmailForm";
import ContinueWithProviders from "./ContinueWithProviders";
import { routes } from "@/shared/config/routes";
const LoginCard = () => {
return (
@ -16,7 +17,7 @@ const LoginCard = () => {
{/* Sign up link */}
<p className="text-center text-neutral-300 text-sm font-light mt-5">
Don't have an account?{" "}
<Link className="text-sm font-medium" href="/sign-up">
<Link className="text-sm font-medium" href={routes.signup}>
Sign Up
</Link>
</p>