From 898666f1df1c5c72f727351cf5c71caef5173722 Mon Sep 17 00:00:00 2001 From: Shilpa Chauhan Date: Fri, 17 May 2024 13:24:46 +0530 Subject: [PATCH] Make a reusable folder for common components and shift imports accordingly --- app/components/communities_components/CommunitiesNavbar.tsx | 2 +- .../CategoriesAndGenderDetailsPopup.tsx | 2 +- .../CategoriesDropdown.tsx | 0 app/components/{ => reusable}/Footer.tsx | 0 app/components/{ => reusable}/HomeNavbar.tsx | 5 ++--- .../{communities_components => reusable}/SearchBar.tsx | 0 app/layout.tsx | 2 -- app/page.tsx | 6 +++--- app/voyager/communities/page.tsx | 2 +- app/voyager/my_account/page.tsx | 6 +++--- app/voyager/profile/page.tsx | 2 +- 11 files changed, 12 insertions(+), 15 deletions(-) rename app/components/{my_account_components => reusable}/CategoriesDropdown.tsx (100%) rename app/components/{ => reusable}/Footer.tsx (100%) rename app/components/{ => reusable}/HomeNavbar.tsx (94%) rename app/components/{communities_components => reusable}/SearchBar.tsx (100%) diff --git a/app/components/communities_components/CommunitiesNavbar.tsx b/app/components/communities_components/CommunitiesNavbar.tsx index 57ddd3c..cd99725 100644 --- a/app/components/communities_components/CommunitiesNavbar.tsx +++ b/app/components/communities_components/CommunitiesNavbar.tsx @@ -2,7 +2,7 @@ import { v4 as uuidv4 } from "uuid"; import Link from "next/link"; -import SearchBar from "./SearchBar"; +import SearchBar from "../reusable/SearchBar"; import { DISCOVER_NAVBAR_LINKS } from "@/app/utils/constants"; const Navbar = () => { diff --git a/app/components/random_chat_components/CategoriesAndGenderDetailsPopup.tsx b/app/components/random_chat_components/CategoriesAndGenderDetailsPopup.tsx index 949438d..120cdba 100644 --- a/app/components/random_chat_components/CategoriesAndGenderDetailsPopup.tsx +++ b/app/components/random_chat_components/CategoriesAndGenderDetailsPopup.tsx @@ -1,6 +1,6 @@ import React from "react"; import Image from "next/image"; -import CategoriesDropdown from "@/app/components/my_account_components/CategoriesDropdown"; +import CategoriesDropdown from "@/app/components/reusable/CategoriesDropdown"; const CategoriesAndGenderDetailsPopup = () => { return ( diff --git a/app/components/my_account_components/CategoriesDropdown.tsx b/app/components/reusable/CategoriesDropdown.tsx similarity index 100% rename from app/components/my_account_components/CategoriesDropdown.tsx rename to app/components/reusable/CategoriesDropdown.tsx diff --git a/app/components/Footer.tsx b/app/components/reusable/Footer.tsx similarity index 100% rename from app/components/Footer.tsx rename to app/components/reusable/Footer.tsx diff --git a/app/components/HomeNavbar.tsx b/app/components/reusable/HomeNavbar.tsx similarity index 94% rename from app/components/HomeNavbar.tsx rename to app/components/reusable/HomeNavbar.tsx index 5dc19b4..913e167 100644 --- a/app/components/HomeNavbar.tsx +++ b/app/components/reusable/HomeNavbar.tsx @@ -2,12 +2,11 @@ import { useState, useRef, useEffect } from "react"; import { IoMdClose } from "react-icons/io"; import { GiHamburgerMenu } from "react-icons/gi"; -import { NAVBAR_LINKS } from "../utils/constants"; +import { NAVBAR_LINKS } from "@/app/utils/constants"; import { v4 as uuidv4 } from "uuid"; import Link from "next/link"; -import { Zklogin } from "../utils/Zklogin"; +import { Zklogin, AccountData } from "@/app/utils/Zklogin"; import { CgProfile } from "react-icons/cg"; -import { AccountData } from "../utils/Zklogin"; import { IoIosLogOut } from "react-icons/io"; /** diff --git a/app/components/communities_components/SearchBar.tsx b/app/components/reusable/SearchBar.tsx similarity index 100% rename from app/components/communities_components/SearchBar.tsx rename to app/components/reusable/SearchBar.tsx diff --git a/app/layout.tsx b/app/layout.tsx index d3b6da6..d58c942 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,8 +1,6 @@ import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; -import Navbar from "./components/HomeNavbar"; -import Footer from "./components/Footer"; const inter = Inter({ subsets: ["latin"] }); diff --git a/app/page.tsx b/app/page.tsx index 14200dc..11da411 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,10 +1,10 @@ import Image from "next/image"; +import HomeNavbar from "./components/reusable/HomeNavbar"; import { LANDING_PAGE_BUTTON } from "./utils/constants"; import { v4 as uuidv4 } from "uuid"; import MembershipPlanCard1 from "./components/membership_plan_cards/MembershipPlanCard1"; import MembershipPlanCard2 from "./components/membership_plan_cards/MembershipPlanCard2"; -import HomeNavbar from "./components/HomeNavbar"; -import Footer from "./components/Footer"; +import Footer from "./components/reusable/Footer"; /* * @@ -14,7 +14,7 @@ import Footer from "./components/Footer"; export default function Home() { return (
- +
diff --git a/app/voyager/communities/page.tsx b/app/voyager/communities/page.tsx index 4c4a77c..ea42e06 100644 --- a/app/voyager/communities/page.tsx +++ b/app/voyager/communities/page.tsx @@ -5,7 +5,7 @@ import { v4 as uuidv4 } from "uuid"; import { DISCOVER_PAGE_BUTTONS } from "../../utils/constants"; import Image from "next/image"; import VivrantCommunitiesCard from "../../components/communities_components/VivrantCommunitiesCard"; -import Footer from "@/app/components/Footer"; +import Footer from "@/app/components/reusable/Footer"; const Community = () => { return ( diff --git a/app/voyager/my_account/page.tsx b/app/voyager/my_account/page.tsx index ae30f19..415eee7 100644 --- a/app/voyager/my_account/page.tsx +++ b/app/voyager/my_account/page.tsx @@ -3,9 +3,9 @@ import { useState } from "react"; import Image from "next/image"; import { useSearchParams } from "next/navigation"; -import HomeNavbar from "@/app/components/HomeNavbar"; -import Footer from "@/app/components/Footer"; -import CategoriesDropdown from "@/app/components/my_account_components/CategoriesDropdown"; +import HomeNavbar from "@/app/components/reusable/HomeNavbar"; +import Footer from "@/app/components/reusable/Footer"; +import CategoriesDropdown from "@/app/components/reusable/CategoriesDropdown"; const MyAccount = () => { const [gender, setGender] = useState(); diff --git a/app/voyager/profile/page.tsx b/app/voyager/profile/page.tsx index 50376a5..c4fb3d9 100644 --- a/app/voyager/profile/page.tsx +++ b/app/voyager/profile/page.tsx @@ -3,7 +3,7 @@ import ProfileNavbar from "../../components/profile_components/ProfileNavbar"; import Image from "next/image"; import { v4 as uuidv4 } from "uuid"; import { PROFILE_PAGE_IMAGES } from "../../utils/constants"; -import Footer from "@/app/components/Footer"; +import Footer from "@/app/components/reusable/Footer"; const Profile = () => { return (