From dab9ec79e9882e28b5370658678927fdda8886e0 Mon Sep 17 00:00:00 2001 From: Ben Bolte Date: Sat, 3 Aug 2024 05:08:48 -0700 Subject: [PATCH] name changes (#238) --- frontend/src/App.tsx | 4 ++-- frontend/src/components/auth/AuthBlock.tsx | 4 ++-- frontend/src/components/auth/RequireAuthentication.tsx | 2 +- frontend/src/components/listing/EditListingModal.tsx | 4 ++-- frontend/src/components/listing/ListingArtifacts.tsx | 4 ++-- frontend/src/components/listing/ListingDeleteButton.tsx | 4 ++-- frontend/src/components/listing/ListingDescription.tsx | 4 ++-- frontend/src/components/listing/ListingHeader.tsx | 4 ++-- frontend/src/components/listings/ListingGrid.tsx | 4 ++-- frontend/src/components/nav/Boop.tsx | 4 ++-- frontend/src/components/nav/Sidebar.tsx | 2 +- frontend/src/hooks/{alerts.tsx => useAlertQueue.tsx} | 0 frontend/src/hooks/{auth.tsx => useAuth.tsx} | 0 frontend/src/hooks/{boop.tsx => useBoop.tsx} | 4 ++-- frontend/src/hooks/useGetListing.tsx | 4 ++-- frontend/src/hooks/useGetUserListing.tsx | 4 ++-- frontend/src/pages/Browse.tsx | 4 ++-- frontend/src/pages/Create.tsx | 4 ++-- frontend/src/pages/ListingDetails.tsx | 4 ++-- frontend/src/pages/Logout.tsx | 4 ++-- 20 files changed, 34 insertions(+), 34 deletions(-) rename frontend/src/hooks/{alerts.tsx => useAlertQueue.tsx} (100%) rename frontend/src/hooks/{auth.tsx => useAuth.tsx} (100%) rename frontend/src/hooks/{boop.tsx => useBoop.tsx} (96%) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9af49811..6865dd40 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,8 +2,8 @@ import Container from "components/Container"; import Footer from "components/footer/Footer"; import Navbar from "components/nav/Navbar"; import NotFoundRedirect from "components/NotFoundRedirect"; -import { AlertQueue, AlertQueueProvider } from "hooks/alerts"; -import { AuthenticationProvider } from "hooks/auth"; +import { AlertQueue, AlertQueueProvider } from "hooks/useAlertQueue"; +import { AuthenticationProvider } from "hooks/useAuth"; import { DarkModeProvider } from "hooks/useDarkMode"; import About from "pages/About"; import APIKeys from "pages/APIKeys"; diff --git a/frontend/src/components/auth/AuthBlock.tsx b/frontend/src/components/auth/AuthBlock.tsx index f05ff143..f7f251bb 100644 --- a/frontend/src/components/auth/AuthBlock.tsx +++ b/frontend/src/components/auth/AuthBlock.tsx @@ -2,8 +2,8 @@ import BackButton from "components/ui/Button/BackButton"; import { Card, CardContent, CardFooter, CardHeader } from "components/ui/Card"; import Header from "components/ui/Header"; import Spinner from "components/ui/Spinner"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; import AuthProvider from "./AuthProvider"; import LoginForm from "./LoginForm"; diff --git a/frontend/src/components/auth/RequireAuthentication.tsx b/frontend/src/components/auth/RequireAuthentication.tsx index 4f806e74..44d8ff08 100644 --- a/frontend/src/components/auth/RequireAuthentication.tsx +++ b/frontend/src/components/auth/RequireAuthentication.tsx @@ -1,5 +1,5 @@ import LogInModal from "components/auth/AuthenticationModal"; -import { useAuthentication } from "hooks/auth"; +import { useAuthentication } from "hooks/useAuth"; import React from "react"; interface Props { diff --git a/frontend/src/components/listing/EditListingModal.tsx b/frontend/src/components/listing/EditListingModal.tsx index e58a5ffe..72bbd013 100644 --- a/frontend/src/components/listing/EditListingModal.tsx +++ b/frontend/src/components/listing/EditListingModal.tsx @@ -11,8 +11,8 @@ import { import ErrorMessage from "components/ui/ErrorMessage"; import { Input, TextArea } from "components/ui/Input/Input"; import { paths } from "gen/api"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; import { SubmitHandler, useForm } from "react-hook-form"; import { NewListingSchema, NewListingType } from "types"; diff --git a/frontend/src/components/listing/ListingArtifacts.tsx b/frontend/src/components/listing/ListingArtifacts.tsx index 334ca036..062ca98a 100644 --- a/frontend/src/components/listing/ListingArtifacts.tsx +++ b/frontend/src/components/listing/ListingArtifacts.tsx @@ -1,7 +1,7 @@ import Carousel from "components/ui/Carousel"; import { components } from "gen/api"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; interface Props { diff --git a/frontend/src/components/listing/ListingDeleteButton.tsx b/frontend/src/components/listing/ListingDeleteButton.tsx index c6b9ea59..0cd81520 100644 --- a/frontend/src/components/listing/ListingDeleteButton.tsx +++ b/frontend/src/components/listing/ListingDeleteButton.tsx @@ -1,6 +1,6 @@ import { Button } from "components/ui/Button/Button"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useState } from "react"; import { FaExclamation } from "react-icons/fa"; import { useNavigate } from "react-router-dom"; diff --git a/frontend/src/components/listing/ListingDescription.tsx b/frontend/src/components/listing/ListingDescription.tsx index f0bf44e6..90ceb213 100644 --- a/frontend/src/components/listing/ListingDescription.tsx +++ b/frontend/src/components/listing/ListingDescription.tsx @@ -1,8 +1,8 @@ import { Button } from "components/ui/Button/Button"; import { TextArea } from "components/ui/Input/Input"; import Spinner from "components/ui/Spinner"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useState } from "react"; import { FaFile, FaPen } from "react-icons/fa"; import Markdown from "react-markdown"; diff --git a/frontend/src/components/listing/ListingHeader.tsx b/frontend/src/components/listing/ListingHeader.tsx index 29657ea3..ef45d93e 100644 --- a/frontend/src/components/listing/ListingHeader.tsx +++ b/frontend/src/components/listing/ListingHeader.tsx @@ -1,8 +1,8 @@ import { Button } from "components/ui/Button/Button"; import { Input } from "components/ui/Input/Input"; import Spinner from "components/ui/Spinner"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useState } from "react"; import { FaFile, FaPen, FaTimes } from "react-icons/fa"; import { useNavigate } from "react-router-dom"; diff --git a/frontend/src/components/listings/ListingGrid.tsx b/frontend/src/components/listings/ListingGrid.tsx index d0fd84ee..d2826dcd 100644 --- a/frontend/src/components/listings/ListingGrid.tsx +++ b/frontend/src/components/listings/ListingGrid.tsx @@ -1,7 +1,7 @@ import Spinner from "components/ui/Spinner"; import { paths } from "gen/api"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; import ListingGridCard from "./ListingGridCard"; diff --git a/frontend/src/components/nav/Boop.tsx b/frontend/src/components/nav/Boop.tsx index 7d7022a2..84ea1917 100644 --- a/frontend/src/components/nav/Boop.tsx +++ b/frontend/src/components/nav/Boop.tsx @@ -1,4 +1,4 @@ -import boop from "hooks/boop"; +import useBoop from "hooks/useBoop"; import React from "react"; import { animated } from "react-spring"; @@ -19,7 +19,7 @@ const Boop: React.FC = ({ timing = 3000, children, }) => { - const [style, trigger] = boop({ x, y, rotation, scale, timing }); + const [style, trigger] = useBoop({ x, y, rotation, scale, timing }); return ( diff --git a/frontend/src/components/nav/Sidebar.tsx b/frontend/src/components/nav/Sidebar.tsx index 0777a3f4..c0217002 100644 --- a/frontend/src/components/nav/Sidebar.tsx +++ b/frontend/src/components/nav/Sidebar.tsx @@ -1,5 +1,5 @@ import clsx from "clsx"; -import { useAuthentication } from "hooks/auth"; +import { useAuthentication } from "hooks/useAuth"; import { FaBookOpen, FaDoorClosed, diff --git a/frontend/src/hooks/alerts.tsx b/frontend/src/hooks/useAlertQueue.tsx similarity index 100% rename from frontend/src/hooks/alerts.tsx rename to frontend/src/hooks/useAlertQueue.tsx diff --git a/frontend/src/hooks/auth.tsx b/frontend/src/hooks/useAuth.tsx similarity index 100% rename from frontend/src/hooks/auth.tsx rename to frontend/src/hooks/useAuth.tsx diff --git a/frontend/src/hooks/boop.tsx b/frontend/src/hooks/useBoop.tsx similarity index 96% rename from frontend/src/hooks/boop.tsx rename to frontend/src/hooks/useBoop.tsx index b9dc2a50..a5526470 100644 --- a/frontend/src/hooks/boop.tsx +++ b/frontend/src/hooks/useBoop.tsx @@ -10,7 +10,7 @@ interface BoopProps { springConfig?: SpringConfig; } -function boop({ +function useBoop({ x = 100, y = 100, rotation = 0, @@ -57,4 +57,4 @@ function boop({ return [appliedStyle, trigger] as const; } -export default boop; +export default useBoop; diff --git a/frontend/src/hooks/useGetListing.tsx b/frontend/src/hooks/useGetListing.tsx index cd23a6e2..e5ba2f3e 100644 --- a/frontend/src/hooks/useGetListing.tsx +++ b/frontend/src/hooks/useGetListing.tsx @@ -1,7 +1,7 @@ import { paths } from "gen/api"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; -import { useAlertQueue } from "./alerts"; -import { useAuthentication } from "./auth"; type ListingResponse = paths["/listings/{id}"]["get"]["responses"][200]["content"]["application/json"]; diff --git a/frontend/src/hooks/useGetUserListing.tsx b/frontend/src/hooks/useGetUserListing.tsx index 319cb89e..1e22238d 100644 --- a/frontend/src/hooks/useGetUserListing.tsx +++ b/frontend/src/hooks/useGetUserListing.tsx @@ -1,6 +1,6 @@ +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; -import { useAlertQueue } from "./alerts"; -import { useAuthentication } from "./auth"; const useGetUserListing = ({ pageNumber, diff --git a/frontend/src/pages/Browse.tsx b/frontend/src/pages/Browse.tsx index 9686ac3f..63aae77d 100644 --- a/frontend/src/pages/Browse.tsx +++ b/frontend/src/pages/Browse.tsx @@ -1,8 +1,8 @@ import { useDebounce } from "@uidotdev/usehooks"; import ListingGrid from "components/listings/ListingGrid"; import { Input } from "components/ui/Input/Input"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; import { FaTimes } from "react-icons/fa"; import { useNavigate, useSearchParams } from "react-router-dom"; diff --git a/frontend/src/pages/Create.tsx b/frontend/src/pages/Create.tsx index cc3efe92..6fe8743e 100644 --- a/frontend/src/pages/Create.tsx +++ b/frontend/src/pages/Create.tsx @@ -6,8 +6,8 @@ import { Card, CardContent, CardHeader } from "components/ui/Card"; import ErrorMessage from "components/ui/ErrorMessage"; import Header from "components/ui/Header"; import { Input, TextArea } from "components/ui/Input/Input"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { useNavigate } from "react-router-dom"; diff --git a/frontend/src/pages/ListingDetails.tsx b/frontend/src/pages/ListingDetails.tsx index da386a95..e8021af9 100644 --- a/frontend/src/pages/ListingDetails.tsx +++ b/frontend/src/pages/ListingDetails.tsx @@ -3,8 +3,8 @@ import ListingFooter from "components/listing/ListingFooter"; import ListingHeader from "components/listing/ListingHeader"; import Spinner from "components/ui/Spinner"; import { paths } from "gen/api"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; diff --git a/frontend/src/pages/Logout.tsx b/frontend/src/pages/Logout.tsx index 998b69b2..53d154ed 100644 --- a/frontend/src/pages/Logout.tsx +++ b/frontend/src/pages/Logout.tsx @@ -1,8 +1,8 @@ import { Card, CardContent, CardHeader } from "components/ui/Card"; import Header from "components/ui/Header"; import Spinner from "components/ui/Spinner"; -import { useAlertQueue } from "hooks/alerts"; -import { useAuthentication } from "hooks/auth"; +import { useAlertQueue } from "hooks/useAlertQueue"; +import { useAuthentication } from "hooks/useAuth"; import { useEffect } from "react"; const Logout = () => {