diff --git a/src/components/userComponents/emailPopup/page.tsx b/src/components/userComponents/emailPopup/page.tsx index e9c1518d..b1e40683 100644 --- a/src/components/userComponents/emailPopup/page.tsx +++ b/src/components/userComponents/emailPopup/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { Fragment, useState } from 'react'; +import React, { ChangeEventHandler, Fragment, useState } from 'react'; import { Dialog, Transition } from '@headlessui/react'; import { PiPaperPlaneTiltBold, PiSealCheck } from 'react-icons/pi'; import { VscClose } from 'react-icons/vsc'; @@ -10,8 +10,9 @@ import supabase from '../../../supabase/client'; /** * - * @param root0 - * @param root0.backLink + * @param props - props + * @param props.backLink - the link to the page the user will be directed to after they subscribe + * @returns an email pop up. */ function EmailSuccess({ backLink }: { backLink: string }) { return ( @@ -47,7 +48,9 @@ function EmailSuccess({ backLink }: { backLink: string }) { type EmailInputProps = { inputValue: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any handleChange: (e: any) => void; + // eslint-disable-next-line @typescript-eslint/no-explicit-any handleSubmit: (e: any) => void; showError: boolean; errorMsg: string; @@ -55,12 +58,13 @@ type EmailInputProps = { /** * - * @param root0 - * @param root0.inputValue - * @param root0.handleChange - * @param root0.handleSubmit - * @param root0.showError - * @param root0.errorMsg + * @param props - props + * @param props.inputValue - the value of the email input + * @param props.handleChange - the function that handles the change of the email input + * @param props.handleSubmit - the function that handles the submission of the email input + * @param props.showError - a boolean that determines if the error message should be shown + * @param props.errorMsg - the error message that will be shown if showError is true + * @returns an email pop up. */ function EmailInput({ inputValue, @@ -125,10 +129,8 @@ function EmailInput({ } /** - * @param root0 - * @param root0.backLink - * @param root0 - * @param root0.backLink + * @param props - props + * @param props.backLink - the link to the page the user will be directed to after they subscribe * @returns an email pop up. * if no email is entered and the user clicks the submit button, an error message will pop up. * if an invalid email is entered and the user clicks the submit button, another error message will pop up. @@ -145,19 +147,21 @@ export default function EmailPopup({ backLink }: { backLink: string }) { setIsOpen(false); }; - const handleChange = e => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const handleChange = (e : any) => { setInputValue(e.target.value); setShowError(false); }; // const { error } = await supabase.from('emails').insert({ id: 1, name: 'Denmark' }) - const isValidEmail = email => { + const isValidEmail = (email : string) => { const emailRegex = /^[^\s@]+@[^\s@]+\.(com|ca)$/; return emailRegex.test(email); }; - const handleSubmit = async e => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any, consistent-return + const handleSubmit = async (e : any) => { e.preventDefault(); if (!inputValue.trim()) { diff --git a/src/components/userComponents/navBar/navBar.tsx b/src/components/userComponents/navBar/navBar.tsx index 46cbb9e9..c524076f 100644 --- a/src/components/userComponents/navBar/navBar.tsx +++ b/src/components/userComponents/navBar/navBar.tsx @@ -100,7 +100,7 @@ export default function NavBar() { href="/newsFeedPage" className="text-night font-lato text-lg font-bold block relative left-4 mt-[1.25rem]" > - News Feed + News diff --git a/src/supabase/category/queries.ts b/src/supabase/category/queries.ts index 4a81885a..392f6f85 100644 --- a/src/supabase/category/queries.ts +++ b/src/supabase/category/queries.ts @@ -5,9 +5,7 @@ import { CategoryRow } from '../../types/types'; // Assume this function is in `supabase/category/queries.js` /** * - * @param category category to retreive color - - * @param id + * @param id category id to retreive color for * @returns color for category, else null */ // eslint-disable-next-line import/prefer-default-export diff --git a/src/supabase/category/queries.tsx b/src/supabase/category/queries.tsx index 1624ba41..94dd2157 100644 --- a/src/supabase/category/queries.tsx +++ b/src/supabase/category/queries.tsx @@ -22,8 +22,8 @@ import supabase from '../client'; // Assume this function is in `supabase/category/queries.js` /** * - * @param category which category to get color from - * @returns color of category + * @param category - The category for which you want to fetch the color + * @returns The color for the category */ // eslint-disable-next-line import/prefer-default-export export async function getCategoryColor1(category: string) { diff --git a/src/supabase/displays/queries.tsx b/src/supabase/displays/queries.tsx index 6b3fbd7d..ce7e37db 100644 --- a/src/supabase/displays/queries.tsx +++ b/src/supabase/displays/queries.tsx @@ -4,7 +4,7 @@ import { DisplayRow } from '../../types/types'; import supabase from '../client'; /** - * + * @returns all displays from the database */ export async function fetchAllDisplays() { const { data, error } = await supabase.from('displays').select('*'); @@ -16,7 +16,8 @@ export async function fetchAllDisplays() { /** * - * @param id + * @param id - display id + * @returns a display from the database */ export async function fetchDisplay(id: string) { const { data, error } = await supabase @@ -32,7 +33,7 @@ export async function fetchDisplay(id: string) { /** * - * @param id + * @param id - display id */ export async function deleteDisplay(id: string) { const { error } = await supabase.from('displays').delete().eq('id', id); @@ -46,7 +47,8 @@ export async function deleteDisplay(id: string) { /** * - * @param displayData + * @param displayData - the display row to create + * @returns the new display row */ export async function createDisplay(displayData: DisplayRow) { const { data, error } = await supabase.from('displays').upsert([displayData]); diff --git a/tailwind.config.ts b/tailwind.config.ts index 89c4f6ea..d2cbeddb 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -57,6 +57,7 @@ const config: Config = { }, }, }, + // eslint-disable-next-line import/no-extraneous-dependencies, global-require plugins: [require('daisyui')], }; export default config;