From 07cc7155651b65768f26cd2eeff621b5d33f1d28 Mon Sep 17 00:00:00 2001 From: sidlak-c137 Date: Sun, 1 Oct 2023 16:49:50 -0700 Subject: [PATCH] test fixes of imports --- Context/AuthContext.tsx | 2 +- components/AdminForm.tsx | 18 +++++------------- components/GithubButton.tsx | 2 +- components/Header.tsx | 2 +- components/Layout.tsx | 4 ++-- components/Sidebar.tsx | 2 +- components/SignInButton.tsx | 3 +-- devpages/admin.tsx | 6 +++--- devpages/dashboard.tsx | 2 +- devpages/private_project.tsx | 2 +- devpages/profile.tsx | 2 +- devpages/resources.tsx | 2 +- pages/_app.tsx | 4 ++-- pages/about.tsx | 4 ++-- pages/events.tsx | 8 ++++---- pages/index.tsx | 6 +++--- pages/join.tsx | 12 ++++-------- pages/projects.tsx | 4 ++-- 18 files changed, 36 insertions(+), 49 deletions(-) diff --git a/Context/AuthContext.tsx b/Context/AuthContext.tsx index 6108cde..58e3859 100644 --- a/Context/AuthContext.tsx +++ b/Context/AuthContext.tsx @@ -1,7 +1,7 @@ import { createContext, useContext, useEffect, useState } from "react" import { GithubAuthProvider, GoogleAuthProvider, signInWithPopup } from "firebase/auth" -import { auth } from "back_end/utils" +import { auth } from "@/back_end/utils" // @ts-ignore import { checkAdmin } from "@/utils/api"; diff --git a/components/AdminForm.tsx b/components/AdminForm.tsx index 24807e3..a709f8a 100644 --- a/components/AdminForm.tsx +++ b/components/AdminForm.tsx @@ -2,16 +2,10 @@ import React, { useEffect, useRef, useState } from "react"; import { Box, Button, - Divider, - Heading, - FormControl, FormLabel, Input, Textarea, - VStack, Flex, - Grid, - Spacer } from "@chakra-ui/react"; import { @@ -22,14 +16,12 @@ import { personTemplate, projectTemplate, Value -} from "../devpages/admin"; +} from "@/devpages/admin"; -import * as ImageService from "../back_end/api/image.js" -import * as EventService from "../back_end/api/events.js" -import * as LeadService from "../back_end/api/leads.js" -import * as ProjectService from "../back_end/api/projects.js" - -import { connectStorageEmulator } from "firebase/storage"; +import * as ImageService from "@/back_end/api/image.js" +import * as EventService from "@/back_end/api/events.js" +import * as LeadService from "@/back_end/api/leads.js" +import * as ProjectService from "@/back_end/api/projects.js" type _Item = _Person | _Project | _Event; diff --git a/components/GithubButton.tsx b/components/GithubButton.tsx index ce9d74d..8c41693 100644 --- a/components/GithubButton.tsx +++ b/components/GithubButton.tsx @@ -2,7 +2,7 @@ // Set to be removed import React from "react"; import { UserCredential } from "firebase/auth"; -import { useAuth } from "context/AuthContext" +import { useAuth } from "@/context/AuthContext" import { Button, Center, Text } from '@chakra-ui/react' import { VscGithub } from "react-icons/vsc" diff --git a/components/Header.tsx b/components/Header.tsx index 021b955..d2e5ef6 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -13,7 +13,7 @@ import { useMediaQuery } from "@chakra-ui/react"; import { faBars } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { HeaderButton, SpecialHeaderButton } from "./Parts"; -import { useAuth } from "context/AuthContext"; +import { useAuth } from "@/context/AuthContext"; export default function Header(props: { showSidebar: () => void }) { const [isLargerThan1200] = useMediaQuery("(min-width: 1200px)"); diff --git a/components/Layout.tsx b/components/Layout.tsx index 046b393..c37dab3 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -1,8 +1,8 @@ import Head from "next/head"; import { Box, Flex, useMediaQuery } from "@chakra-ui/react"; import { ReactElement, useEffect, useState } from "react"; -import Header from "../components/Header"; -import Footer from "../components/Footer"; +import Header from "./Header"; +import Footer from "./Footer"; import Sidebar from "./Sidebar"; export default function Layout({ children }: { children: ReactElement }) { diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 6619670..3685f56 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -2,7 +2,7 @@ import { Flex, IconButton } from "@chakra-ui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faXmark } from "@fortawesome/free-solid-svg-icons"; import { SidebarButton } from "./Parts"; -import { useAuth } from "context/AuthContext"; +import { useAuth } from "@/context/AuthContext"; interface ISideBar { show: boolean; diff --git a/components/SignInButton.tsx b/components/SignInButton.tsx index b8fae67..b937af8 100644 --- a/components/SignInButton.tsx +++ b/components/SignInButton.tsx @@ -2,11 +2,10 @@ // Set to be removed import React from "react"; import { UserCredential } from "firebase/auth"; -import { useAuth } from "../context/AuthContext" +import { useAuth } from "@/context/AuthContext" import { Button, Center, Text } from '@chakra-ui/react' import { VscGithub } from "react-icons/vsc" -import { checkMembership, getGithubUser } from "utils/api" interface SignInProps { onSignInSuccess: (result: UserCredential) => void; } diff --git a/devpages/admin.tsx b/devpages/admin.tsx index 21da4bf..870d1ff 100644 --- a/devpages/admin.tsx +++ b/devpages/admin.tsx @@ -1,11 +1,11 @@ import { useEffect, useState } from "react"; -import AdminForm from "../components/AdminForm"; +import AdminForm from "@/components/AdminForm"; import { getAllEvents } from "back_end/api/events"; // import { events, people, projects } from '../utils/data'; -import { getLeads } from "back_end/api/leads"; -import { getProjects } from "back_end/api/projects"; +import { getLeads } from "@/back_end/api/leads"; +import { getProjects } from "@/back_end/api/projects"; import { set } from 'firebase/database'; diff --git a/devpages/dashboard.tsx b/devpages/dashboard.tsx index a25782b..4562314 100644 --- a/devpages/dashboard.tsx +++ b/devpages/dashboard.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "context/AuthContext"; +import { useAuth } from "@/context/AuthContext"; import { useEffect } from "react"; import Router from "next/router"; import { Center, Text } from "@chakra-ui/react"; diff --git a/devpages/private_project.tsx b/devpages/private_project.tsx index 0c2ac90..3fcc1d9 100644 --- a/devpages/private_project.tsx +++ b/devpages/private_project.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "context/AuthContext"; +import { useAuth } from "@/context/AuthContext"; import { useEffect } from "react"; import Router from "next/router"; import { Center, Text } from "@chakra-ui/react"; diff --git a/devpages/profile.tsx b/devpages/profile.tsx index 3a03ecf..571c85e 100644 --- a/devpages/profile.tsx +++ b/devpages/profile.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "context/AuthContext"; +import { useAuth } from "@/context/AuthContext"; import { useEffect } from "react"; import Router from "next/router"; import { Center, Text } from "@chakra-ui/react"; diff --git a/devpages/resources.tsx b/devpages/resources.tsx index 7cbf260..84960b3 100644 --- a/devpages/resources.tsx +++ b/devpages/resources.tsx @@ -1,4 +1,4 @@ -import { useAuth } from "context/AuthContext"; +import { useAuth } from "@/context/AuthContext"; import { useEffect } from "react"; import Router from "next/router"; import { Center, Text } from "@chakra-ui/react"; diff --git a/pages/_app.tsx b/pages/_app.tsx index 7fc3947..4097897 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -3,8 +3,8 @@ import type { AppProps } from "next/app"; import { ChakraProvider } from "@chakra-ui/react"; import { extendTheme, theme as baseTheme } from "@chakra-ui/react"; -import Layout from "../components/Layout"; -import { AuthContextProvider } from "context/AuthContext"; +import Layout from "@/components/Layout"; +import { AuthContextProvider } from "@/context/AuthContext"; const colors = { brand: { diff --git a/pages/about.tsx b/pages/about.tsx index 119889a..3868a4b 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -9,8 +9,8 @@ import { Spinner, useMediaQuery, } from "@chakra-ui/react"; -import { getPeople } from "utils/api"; -import { IPeopleInfo } from "utils/parsers"; +import { getPeople } from "@/utils/api"; +import { IPeopleInfo } from "@/utils/parsers"; export default function About() { // Scroll to top of page diff --git a/pages/events.tsx b/pages/events.tsx index c5c807d..69c99bb 100644 --- a/pages/events.tsx +++ b/pages/events.tsx @@ -10,11 +10,11 @@ import { // @ts-ignore import { getAllEvents } from "@/utils/api"; import { lazy, useEffect, useState } from "react"; -import { IEventInfo } from "utils/parsers"; -import EventPanel from "components/EventPanel"; -import EventCardFull from "components/EventCardFull"; +import { IEventInfo } from "@/utils/parsers"; +import EventPanel from "@/components/EventPanel"; +import EventCardFull from "@/components/EventCardFull"; -const Room = lazy(() => import("components/Room")); +const Room = lazy(() => import("@/components/Room")); const inter = Inter({ subsets: ["latin"] }); function Title() { diff --git a/pages/index.tsx b/pages/index.tsx index 497703d..0ca2cc9 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -17,12 +17,12 @@ import { faArrowDown } from "@fortawesome/free-solid-svg-icons"; import { getFeaturedEvents } from "@/utils/api"; import Image from 'next/image'; import { lazy, useEffect, useState } from "react"; -import EventCard from "components/EventCard"; -import { IEventInfo } from "utils/parsers"; +import EventCard from "@/components/EventCard"; +import { IEventInfo } from "@/utils/parsers"; -const Room = lazy(() => import("components/Room")); +const Room = lazy(() => import("@/components/Room")); const inter = Inter({ subsets: ["latin"] }); function Title() { diff --git a/pages/join.tsx b/pages/join.tsx index f9b015c..34e861f 100644 --- a/pages/join.tsx +++ b/pages/join.tsx @@ -6,7 +6,6 @@ import { Center, VStack, Input, - Box, Textarea } from "@chakra-ui/react"; @@ -15,15 +14,12 @@ import { faUpRightFromSquare, faEnvelope} from "@fortawesome/free-solid-svg-icon // @ts-ignore import { sendEmail } from "@/utils/api"; // @ts-ignore -import { checkLead } from "@/utils/api"; -// @ts-ignore import { auth } from "@/back_end/utils/index.js" -import SignInComponent from "components/SignInButton"; -import { UserCredential, User, signOut, OAuthCredential} from "firebase/auth"; -import { useAuth } from "context/AuthContext"; -import { exchangeAuth } from "utils/api.js"; -import { SpecialIconButton, SpecialSubmitButton } from "components/Parts"; +import { UserCredential, signOut} from "firebase/auth"; +import { useAuth } from "@/context/AuthContext"; +import { exchangeAuth } from "@/utils/api.js"; +import { SpecialIconButton, SpecialSubmitButton } from "@/components/Parts"; const inter = Inter({ subsets: ["latin"] }); function Title() { diff --git a/pages/projects.tsx b/pages/projects.tsx index 60b9a65..eba862d 100644 --- a/pages/projects.tsx +++ b/pages/projects.tsx @@ -15,8 +15,8 @@ import { faSearch } from "@fortawesome/free-solid-svg-icons"; import { getAllProjects } from "@/utils/api"; import { ChangeEvent, lazy, useEffect, useState } from "react"; import { IProjectInfo } from "utils/parsers"; -import ProjectCard from "components/ProjectCard"; -const Room = lazy(() => import("components/Room")); +import ProjectCard from "@/components/ProjectCard"; +const Room = lazy(() => import("@/components/Room")); const inter = Inter({ subsets: ["latin"] }); function Title() {