Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sidlak-c137 committed Oct 1, 2023
1 parent 07cc715 commit 366521b
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Context/AuthContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createContext, useContext, useEffect, useState } from "react"

import { GithubAuthProvider, GoogleAuthProvider, signInWithPopup } from "firebase/auth"
// @ts-ignore
import { auth } from "@/back_end/utils"

// @ts-ignore
Expand Down Expand Up @@ -38,7 +39,8 @@ export const AuthContextProvider = ({children}: {children:React.ReactNode}) => {

useEffect(() => {

const unsubscribe = auth.onAuthStateChanged(async user => {
// rome-ignore lint/suspicious/noExplicitAny: <explanation>
const unsubscribe = auth.onAuthStateChanged(async (user: any) => {
setCurrentUser(user)
if (user) {
setAdmin(await checkAdmin(user))
Expand Down
5 changes: 5 additions & 0 deletions components/AdminForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ import {
personTemplate,
projectTemplate,
Value
// @ts-ignore
} from "@/devpages/admin";

// @ts-ignore
import * as ImageService from "@/back_end/api/image.js"
// @ts-ignore
import * as EventService from "@/back_end/api/events.js"
// @ts-ignore
import * as LeadService from "@/back_end/api/leads.js"
// @ts-ignore
import * as ProjectService from "@/back_end/api/projects.js"

type _Item = _Person | _Project | _Event;
Expand Down
1 change: 1 addition & 0 deletions components/GithubButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Set to be removed
import React from "react";
import { UserCredential } from "firebase/auth";
// @ts-ignore
import { useAuth } from "@/context/AuthContext"
import { Button, Center, Text } from '@chakra-ui/react'
import { VscGithub } from "react-icons/vsc"
Expand Down
1 change: 1 addition & 0 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +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";
// @ts-ignore
import { useAuth } from "@/context/AuthContext";

export default function Header(props: { showSidebar: () => void }) {
Expand Down
1 change: 1 addition & 0 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +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";
// @ts-ignore
import { useAuth } from "@/context/AuthContext";

interface ISideBar {
Expand Down
1 change: 1 addition & 0 deletions components/SignInButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Set to be removed
import React from "react";
import { UserCredential } from "firebase/auth";
// @ts-ignore
import { useAuth } from "@/context/AuthContext"
import { Button, Center, Text } from '@chakra-ui/react'
import { VscGithub } from "react-icons/vsc"
Expand Down
16 changes: 9 additions & 7 deletions devpages/admin.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@


import { useEffect, useState } from "react";
import { SetStateAction, useEffect, useState } from "react";
// @ts-ignore
import AdminForm from "@/components/AdminForm";
import { getAllEvents } from "back_end/api/events";
// import { events, people, projects } from '../utils/data';
// @ts-ignore
import { getAllEvents } from "@/back_end/api/events";
// @ts-ignore
import { getLeads } from "@/back_end/api/leads";
// @ts-ignore
import { getProjects } from "@/back_end/api/projects";
import { set } from 'firebase/database';


// all dates handled as epoch time!!!
Expand Down Expand Up @@ -100,15 +102,15 @@ export default function Admin() {
const [reset, setReset] = useState<boolean>(false);

useEffect(() => {
getAllEvents().then((res) => {
getAllEvents().then((res: SetStateAction<_Event[]>) => {
setCurrentEvents(res);
});

getLeads().then((res) => {
getLeads().then((res: SetStateAction<_Person[]>) => {
setCurrentPeople(res);
});

getProjects().then((res) => {
getProjects().then((res: SetStateAction<_Project[]>) => {
setCurrentProjects(res);
});

Expand Down
1 change: 1 addition & 0 deletions devpages/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import { useAuth } from "@/context/AuthContext";
import { useEffect } from "react";
import Router from "next/router";
Expand Down
1 change: 1 addition & 0 deletions devpages/private_project.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import { useAuth } from "@/context/AuthContext";
import { useEffect } from "react";
import Router from "next/router";
Expand Down
1 change: 1 addition & 0 deletions devpages/profile.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import { useAuth } from "@/context/AuthContext";
import { useEffect } from "react";
import Router from "next/router";
Expand Down
1 change: 1 addition & 0 deletions devpages/resources.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import { useAuth } from "@/context/AuthContext";
import { useEffect } from "react";
import Router from "next/router";
Expand Down
3 changes: 2 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import "@/styles/globals.css";
import type { AppProps } from "next/app";
import { ChakraProvider } from "@chakra-ui/react";
import { extendTheme, theme as baseTheme } from "@chakra-ui/react";

// @ts-ignore
import Layout from "@/components/Layout";
// @ts-ignore
import { AuthContextProvider } from "@/context/AuthContext";

const colors = {
Expand Down
2 changes: 2 additions & 0 deletions pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
Spinner,
useMediaQuery,
} from "@chakra-ui/react";
// @ts-ignore
import { getPeople } from "@/utils/api";
// @ts-ignore
import { IPeopleInfo } from "@/utils/parsers";

export default function About() {
Expand Down
5 changes: 4 additions & 1 deletion pages/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import {
// @ts-ignore
import { getAllEvents } from "@/utils/api";
import { lazy, useEffect, useState } from "react";
// @ts-ignore
import { IEventInfo } from "@/utils/parsers";
// @ts-ignore
import EventPanel from "@/components/EventPanel";
// @ts-ignore
import EventCardFull from "@/components/EventCardFull";

// @ts-ignore
const Room = lazy(() => import("@/components/Room"));
const inter = Inter({ subsets: ["latin"] });

Expand Down
10 changes: 5 additions & 5 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ import { faArrowDown } from "@fortawesome/free-solid-svg-icons";
import { getFeaturedEvents } from "@/utils/api";
import Image from 'next/image';
import { lazy, useEffect, useState } from "react";
// @ts-ignore
import EventCard from "@/components/EventCard";
// @ts-ignore
import { IEventInfo } from "@/utils/parsers";



// @ts-ignore
const Room = lazy(() => import("@/components/Room"));
const inter = Inter({ subsets: ["latin"] });

Expand Down Expand Up @@ -71,8 +73,7 @@ function Title() {
border='3px solid transparent'
onClick={() => {
document
.getElementById("featured-events")!
.scrollIntoView({ behavior: "smooth" });
.getElementById("featured-events")?.scrollIntoView({ behavior: "smooth" });
}}
_hover={{
border: "3px solid white",
Expand Down Expand Up @@ -119,8 +120,7 @@ function TitleMobile() {
border='3px solid transparent'
onClick={() => {
document
.getElementById(isLargerThan450 ? "featured-events" : "meeting-info" )!
.scrollIntoView({ behavior: "smooth" });
.getElementById(isLargerThan450 ? "featured-events" : "meeting-info" )?.scrollIntoView({ behavior: "smooth" });
}}
_hover={{
border: "3px solid white",
Expand Down
5 changes: 4 additions & 1 deletion pages/join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ import { sendEmail } from "@/utils/api";
import { auth } from "@/back_end/utils/index.js"

import { UserCredential, signOut} from "firebase/auth";
// @ts-ignore
import { useAuth } from "@/context/AuthContext";
// @ts-ignore
import { exchangeAuth } from "@/utils/api.js";
// @ts-ignore
import { SpecialIconButton, SpecialSubmitButton } from "@/components/Parts";
const inter = Inter({ subsets: ["latin"] });

Expand Down Expand Up @@ -164,7 +167,7 @@ export default function Join() {
const handleSignInSuccess = async (result: UserCredential) => {
console.log(isAdmin);
console.log(getUser());
let user = auth.currentUser
const user = auth.currentUser
console.log(await user?.getIdToken());
console.log(await exchangeAuth(user?.getIdToken()))
}
Expand Down
2 changes: 2 additions & 0 deletions pages/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ 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";
// @ts-ignore
import ProjectCard from "@/components/ProjectCard";
// @ts-ignore
const Room = lazy(() => import("@/components/Room"));
const inter = Inter({ subsets: ["latin"] });

Expand Down

0 comments on commit 366521b

Please sign in to comment.