From 56af72a471276d346d9e94f5d12d096888c30b17 Mon Sep 17 00:00:00 2001 From: Aaron William Po Date: Fri, 19 May 2023 23:14:49 -0400 Subject: [PATCH] feat: add react-hot-toast for toast notifs --- package-lock.json | 56 +++++++++++++++---- package.json | 3 +- .../BeerBreweryComments/CommentCardBody.tsx | 1 + .../CommentCardDropdown.tsx | 2 +- .../CommentContentBody.tsx | 2 +- .../BeerBreweryComments/EditCommentBody.tsx | 5 +- src/components/BeerById/BeerInfoHeader.tsx | 2 +- .../BeerById/BeerPostCommentsSection.tsx | 2 +- src/components/BeerIndex/BeerCard.tsx | 2 +- .../BreweryById/BreweryBeerSection.tsx | 2 +- .../BreweryById/BreweryCommentsSection.tsx | 5 +- .../BreweryById/BreweryInfoHeader.tsx | 2 +- src/components/BreweryIndex/BreweryCard.tsx | 2 +- src/components/Login/LoginForm.tsx | 6 +- src/components/ui/CustomToast.tsx | 50 +++++++++++++++++ src/contexts/ToastContext.ts | 8 +++ .../{userContext.ts => UserContext.ts} | 0 src/hooks/auth/useRedirectIfLoggedIn.ts | 2 +- .../beer-likes/useCheckIfUserLikesBeerPost.ts | 2 +- .../useCheckIfUserLikesBreweryPost.ts | 2 +- src/hooks/utilities/useNavbar.ts | 2 +- src/pages/_app.tsx | 8 ++- src/pages/breweries/index.tsx | 2 +- src/pages/user/current.tsx | 2 +- 24 files changed, 140 insertions(+), 30 deletions(-) create mode 100644 src/components/ui/CustomToast.tsx create mode 100644 src/contexts/ToastContext.ts rename src/contexts/{userContext.ts => UserContext.ts} (100%) diff --git a/package-lock.json b/package-lock.json index e0a1f95..ba81f1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,7 @@ "react-dom": "^18.2.0", "react-email": "^1.9.3", "react-hook-form": "^7.43.9", + "react-hot-toast": "^2.4.1", "react-icons": "^4.8.0", "react-intersection-observer": "^9.4.3", "react-map-gl": "^7.0.23", @@ -3541,8 +3542,7 @@ "node_modules/csstype": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", - "dev": true + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/daisyui": { "version": "2.51.6", @@ -5719,6 +5719,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/goober": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.13.tgz", + "integrity": "sha512-jFj3BQeleOoy7t93E9rZ2de+ScC4lQICLwiAQmKMg9F6roKGaLSHoCDYKkWlSafg138jejvq/mTdvmnwDQgqoQ==", + "peerDependencies": { + "csstype": "^3.0.10" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -9353,6 +9361,21 @@ "react": "^16.8.0 || ^17 || ^18" } }, + "node_modules/react-hot-toast": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.4.1.tgz", + "integrity": "sha512-j8z+cQbWIM5LY37pR6uZR6D4LfseplqnuAO4co4u8917hBUvXlEqyP1ZzqVLcqoyUesZZv/ImreoCeHVDpE5pQ==", + "dependencies": { + "goober": "^2.1.10" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": ">=16", + "react-dom": ">=16" + } + }, "node_modules/react-icons": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.8.0.tgz", @@ -11233,9 +11256,9 @@ } }, "node_modules/vm2": { - "version": "3.9.17", - "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.17.tgz", - "integrity": "sha512-AqwtCnZ/ERcX+AVj9vUsphY56YANXxRuqMb7GsDtAr0m0PcQX3u0Aj3KWiXM0YAHy7i6JEeHrwOnwXbGYgRpAw==", + "version": "3.9.19", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", + "integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==", "optional": true, "dependencies": { "acorn": "^8.7.0", @@ -13934,8 +13957,7 @@ "csstype": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", - "dev": true + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "daisyui": { "version": "2.51.6", @@ -15557,6 +15579,12 @@ "slash": "^3.0.0" } }, + "goober": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.13.tgz", + "integrity": "sha512-jFj3BQeleOoy7t93E9rZ2de+ScC4lQICLwiAQmKMg9F6roKGaLSHoCDYKkWlSafg138jejvq/mTdvmnwDQgqoQ==", + "requires": {} + }, "gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -17998,6 +18026,14 @@ "integrity": "sha512-AUDN3Pz2NSeoxQ7Hs6OhQhDr6gtF9YRuutGDwPQqhSUAHJSgGl2VeY3qN19MG0SucpjgDiuMJ4iC5T5uB+eaNQ==", "requires": {} }, + "react-hot-toast": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.4.1.tgz", + "integrity": "sha512-j8z+cQbWIM5LY37pR6uZR6D4LfseplqnuAO4co4u8917hBUvXlEqyP1ZzqVLcqoyUesZZv/ImreoCeHVDpE5pQ==", + "requires": { + "goober": "^2.1.10" + } + }, "react-icons": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.8.0.tgz", @@ -19389,9 +19425,9 @@ } }, "vm2": { - "version": "3.9.17", - "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.17.tgz", - "integrity": "sha512-AqwtCnZ/ERcX+AVj9vUsphY56YANXxRuqMb7GsDtAr0m0PcQX3u0Aj3KWiXM0YAHy7i6JEeHrwOnwXbGYgRpAw==", + "version": "3.9.19", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", + "integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==", "optional": true, "requires": { "acorn": "^8.7.0", diff --git a/package.json b/package.json index 47259d4..7f1b4a2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev --turbo", + "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", @@ -42,6 +42,7 @@ "react-dom": "^18.2.0", "react-email": "^1.9.3", "react-hook-form": "^7.43.9", + "react-hot-toast": "^2.4.1", "react-icons": "^4.8.0", "react-intersection-observer": "^9.4.3", "react-map-gl": "^7.0.23", diff --git a/src/components/BeerBreweryComments/CommentCardBody.tsx b/src/components/BeerBreweryComments/CommentCardBody.tsx index 2f6c606..11e0636 100644 --- a/src/components/BeerBreweryComments/CommentCardBody.tsx +++ b/src/components/BeerBreweryComments/CommentCardBody.tsx @@ -4,6 +4,7 @@ import { FC, useState } from 'react'; import { useInView } from 'react-intersection-observer'; import { z } from 'zod'; import CreateCommentValidationSchema from '@/services/types/CommentSchema/CreateCommentValidationSchema'; + import CommentContentBody from './CommentContentBody'; import EditCommentBody from './EditCommentBody'; diff --git a/src/components/BeerBreweryComments/CommentCardDropdown.tsx b/src/components/BeerBreweryComments/CommentCardDropdown.tsx index cee88c5..a163b46 100644 --- a/src/components/BeerBreweryComments/CommentCardDropdown.tsx +++ b/src/components/BeerBreweryComments/CommentCardDropdown.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import { Dispatch, SetStateAction, FC, useContext } from 'react'; import { FaEllipsisH } from 'react-icons/fa'; import CommentQueryResult from '@/services/types/CommentSchema/CommentQueryResult'; diff --git a/src/components/BeerBreweryComments/CommentContentBody.tsx b/src/components/BeerBreweryComments/CommentContentBody.tsx index d7dcc98..9d6a41a 100644 --- a/src/components/BeerBreweryComments/CommentContentBody.tsx +++ b/src/components/BeerBreweryComments/CommentContentBody.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import useTimeDistance from '@/hooks/utilities/useTimeDistance'; import { format } from 'date-fns'; import { Dispatch, FC, SetStateAction, useContext } from 'react'; diff --git a/src/components/BeerBreweryComments/EditCommentBody.tsx b/src/components/BeerBreweryComments/EditCommentBody.tsx index 768ff25..4b3938b 100644 --- a/src/components/BeerBreweryComments/EditCommentBody.tsx +++ b/src/components/BeerBreweryComments/EditCommentBody.tsx @@ -1,5 +1,5 @@ import { zodResolver } from '@hookform/resolvers/zod'; -import { FC, useState, Dispatch, SetStateAction } from 'react'; +import { FC, useState, Dispatch, SetStateAction, useContext } from 'react'; import { Rating } from 'react-daisyui'; import { useForm, SubmitHandler } from 'react-hook-form'; import { z } from 'zod'; @@ -7,6 +7,7 @@ import useBeerPostComments from '@/hooks/data-fetching/beer-comments/useBeerPost import CommentQueryResult from '@/services/types/CommentSchema/CommentQueryResult'; import CreateCommentValidationSchema from '@/services/types/CommentSchema/CreateCommentValidationSchema'; import useBreweryPostComments from '@/hooks/data-fetching/brewery-comments/useBreweryPostComments'; +import ToastContext from '@/contexts/ToastContext'; import FormError from '../ui/forms/FormError'; import FormInfo from '../ui/forms/FormInfo'; import FormLabel from '../ui/forms/FormLabel'; @@ -42,6 +43,7 @@ const EditCommentBody: FC = ({ resolver: zodResolver(CreateCommentValidationSchema), }); + const { toast } = useContext(ToastContext); const { errors } = formState; const [isDeleting, setIsDeleting] = useState(false); @@ -58,6 +60,7 @@ const EditCommentBody: FC = ({ setInEditMode(true); await handleEditRequest(comment.id, data); await mutate(); + toast.success('Submitted edits'); setInEditMode(false); }; diff --git a/src/components/BeerById/BeerInfoHeader.tsx b/src/components/BeerById/BeerInfoHeader.tsx index 188924c..f53a2f3 100644 --- a/src/components/BeerById/BeerInfoHeader.tsx +++ b/src/components/BeerById/BeerInfoHeader.tsx @@ -2,7 +2,7 @@ import Link from 'next/link'; import format from 'date-fns/format'; import { FC, useContext } from 'react'; -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import { FaRegEdit } from 'react-icons/fa'; import beerPostQueryResult from '@/services/BeerPost/schema/BeerPostQueryResult'; import { z } from 'zod'; diff --git a/src/components/BeerById/BeerPostCommentsSection.tsx b/src/components/BeerById/BeerPostCommentsSection.tsx index 8bf16b7..1329d5b 100644 --- a/src/components/BeerById/BeerPostCommentsSection.tsx +++ b/src/components/BeerById/BeerPostCommentsSection.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import beerPostQueryResult from '@/services/BeerPost/schema/BeerPostQueryResult'; diff --git a/src/components/BeerIndex/BeerCard.tsx b/src/components/BeerIndex/BeerCard.tsx index d1c3d77..9092126 100644 --- a/src/components/BeerIndex/BeerCard.tsx +++ b/src/components/BeerIndex/BeerCard.tsx @@ -3,7 +3,7 @@ import { FC, useContext } from 'react'; import Image from 'next/image'; import beerPostQueryResult from '@/services/BeerPost/schema/BeerPostQueryResult'; import { z } from 'zod'; -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount'; import BeerPostLikeButton from '../BeerById/BeerPostLikeButton'; diff --git a/src/components/BreweryById/BreweryBeerSection.tsx b/src/components/BreweryById/BreweryBeerSection.tsx index 32bb967..5400277 100644 --- a/src/components/BreweryById/BreweryBeerSection.tsx +++ b/src/components/BreweryById/BreweryBeerSection.tsx @@ -5,7 +5,7 @@ import { FC, MutableRefObject, useContext, useRef } from 'react'; import { useInView } from 'react-intersection-observer'; import { z } from 'zod'; import { FaPlus } from 'react-icons/fa'; -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import BeerRecommendationLoadingComponent from '../BeerById/BeerRecommendationLoadingComponent'; interface BreweryCommentsSectionProps { diff --git a/src/components/BreweryById/BreweryCommentsSection.tsx b/src/components/BreweryById/BreweryCommentsSection.tsx index ecc8363..80c770b 100644 --- a/src/components/BreweryById/BreweryCommentsSection.tsx +++ b/src/components/BreweryById/BreweryCommentsSection.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import BreweryPostQueryResult from '@/services/BreweryPost/types/BreweryPostQueryResult'; import { FC, MutableRefObject, useContext, useRef } from 'react'; import { z } from 'zod'; @@ -9,6 +9,7 @@ import APIResponseValidationSchema from '@/validation/APIResponseValidationSchem import CommentQueryResult from '@/services/types/CommentSchema/CommentQueryResult'; import useBreweryPostComments from '@/hooks/data-fetching/brewery-comments/useBreweryPostComments'; +import ToastContext from '@/contexts/ToastContext'; import LoadingComponent from '../BeerById/LoadingComponent'; import CommentsComponent from '../ui/CommentsComponent'; import CommentForm from '../ui/CommentForm'; @@ -63,6 +64,7 @@ const BreweryCommentForm: FC = ({ breweryPost, mutate } resolver: zodResolver(CreateCommentValidationSchema), }); + const { toast } = useContext(ToastContext); const onSubmit: SubmitHandler> = async ( data, ) => { @@ -72,6 +74,7 @@ const BreweryCommentForm: FC = ({ breweryPost, mutate } breweryPostId: breweryPost.id, }); await mutate(); + toast.loading('Created new comment.'); reset(); }; diff --git a/src/components/BreweryById/BreweryInfoHeader.tsx b/src/components/BreweryById/BreweryInfoHeader.tsx index 42cb969..3c7badb 100644 --- a/src/components/BreweryById/BreweryInfoHeader.tsx +++ b/src/components/BreweryById/BreweryInfoHeader.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount'; import useTimeDistance from '@/hooks/utilities/useTimeDistance'; import BreweryPostQueryResult from '@/services/BreweryPost/types/BreweryPostQueryResult'; diff --git a/src/components/BreweryIndex/BreweryCard.tsx b/src/components/BreweryIndex/BreweryCard.tsx index bded816..a9779e8 100644 --- a/src/components/BreweryIndex/BreweryCard.tsx +++ b/src/components/BreweryIndex/BreweryCard.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount'; import BreweryPostQueryResult from '@/services/BreweryPost/types/BreweryPostQueryResult'; import { FC, useContext } from 'react'; diff --git a/src/components/Login/LoginForm.tsx b/src/components/Login/LoginForm.tsx index c10508b..915f2e8 100644 --- a/src/components/Login/LoginForm.tsx +++ b/src/components/Login/LoginForm.tsx @@ -5,7 +5,8 @@ import { useRouter } from 'next/router'; import { useContext, useState } from 'react'; import { useForm, SubmitHandler } from 'react-hook-form'; import { z } from 'zod'; -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; +import ToastContext from '@/contexts/ToastContext'; import ErrorAlert from '../ui/alerts/ErrorAlert'; import FormError from '../ui/forms/FormError'; import FormInfo from '../ui/forms/FormInfo'; @@ -30,12 +31,15 @@ const LoginForm = () => { const [responseError, setResponseError] = useState(''); const { mutate } = useContext(UserContext); + const { toast } = useContext(ToastContext); const onSubmit: SubmitHandler = async (data) => { try { + const id = toast.loading('Logging in.'); await sendLoginUserRequest(data); await mutate!(); await router.push(`/user/current`); + toast.remove(id); } catch (error) { if (error instanceof Error) { setResponseError(error.message); diff --git a/src/components/ui/CustomToast.tsx b/src/components/ui/CustomToast.tsx new file mode 100644 index 0000000..e389a57 --- /dev/null +++ b/src/components/ui/CustomToast.tsx @@ -0,0 +1,50 @@ +import ToastContext from '@/contexts/ToastContext'; +import { FC, ReactNode } from 'react'; +import toast, { Toast, Toaster, resolveValue } from 'react-hot-toast'; +import { FaTimes } from 'react-icons/fa'; + +const toastToClassName = (toastType: Toast['type']) => { + let className: 'alert-success' | 'alert-error' | 'alert-info'; + + switch (toastType) { + case 'success': + className = 'alert-success'; + break; + case 'error': + className = 'alert-error'; + break; + default: + className = 'alert-info'; + } + + return className; +}; + +const CustomToast: FC<{ children: ReactNode }> = ({ children }) => { + return ( + + + {(t) => { + const alertType = toastToClassName(t.type); + return ( +
+
+
{resolveValue(t.message, t)}
+ +
+
+ ); + }} +
+ {children} +
+ ); +}; +export default CustomToast; diff --git a/src/contexts/ToastContext.ts b/src/contexts/ToastContext.ts new file mode 100644 index 0000000..e5b5c5e --- /dev/null +++ b/src/contexts/ToastContext.ts @@ -0,0 +1,8 @@ +import { createContext } from 'react'; +import toast from 'react-hot-toast'; + +const ToastContext = createContext<{ + toast: typeof toast; +}>({ toast }); + +export default ToastContext; diff --git a/src/contexts/userContext.ts b/src/contexts/UserContext.ts similarity index 100% rename from src/contexts/userContext.ts rename to src/contexts/UserContext.ts diff --git a/src/hooks/auth/useRedirectIfLoggedIn.ts b/src/hooks/auth/useRedirectIfLoggedIn.ts index ee6d16a..50e8ac0 100644 --- a/src/hooks/auth/useRedirectIfLoggedIn.ts +++ b/src/hooks/auth/useRedirectIfLoggedIn.ts @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import { useRouter } from 'next/router'; import { useContext } from 'react'; diff --git a/src/hooks/data-fetching/beer-likes/useCheckIfUserLikesBeerPost.ts b/src/hooks/data-fetching/beer-likes/useCheckIfUserLikesBeerPost.ts index 3425ed3..f95dd5b 100644 --- a/src/hooks/data-fetching/beer-likes/useCheckIfUserLikesBeerPost.ts +++ b/src/hooks/data-fetching/beer-likes/useCheckIfUserLikesBeerPost.ts @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { useContext } from 'react'; import useSWR from 'swr'; diff --git a/src/hooks/data-fetching/brewery-likes/useCheckIfUserLikesBreweryPost.ts b/src/hooks/data-fetching/brewery-likes/useCheckIfUserLikesBreweryPost.ts index 0d24194..0cb5b22 100644 --- a/src/hooks/data-fetching/brewery-likes/useCheckIfUserLikesBreweryPost.ts +++ b/src/hooks/data-fetching/brewery-likes/useCheckIfUserLikesBreweryPost.ts @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { useContext } from 'react'; import useSWR from 'swr'; diff --git a/src/hooks/utilities/useNavbar.ts b/src/hooks/utilities/useNavbar.ts index c718a14..184777e 100644 --- a/src/hooks/utilities/useNavbar.ts +++ b/src/hooks/utilities/useNavbar.ts @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import { useRouter } from 'next/router'; import { useState, useEffect, useContext } from 'react'; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index aa265a4..86a4e86 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,4 +1,4 @@ -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import '@/styles/globals.css'; import type { AppProps } from 'next/app'; @@ -11,6 +11,7 @@ import { Space_Grotesk } from 'next/font/google'; import Head from 'next/head'; import Layout from '@/components/ui/Layout'; import useUser from '@/hooks/auth/useUser'; +import CustomToast from '@/components/ui/CustomToast'; const spaceGrotesk = Space_Grotesk({ subsets: ['latin'], @@ -39,9 +40,12 @@ export default function App({ Component, pageProps }: AppProps) { - + + + + ); diff --git a/src/pages/breweries/index.tsx b/src/pages/breweries/index.tsx index 6261df3..275e318 100644 --- a/src/pages/breweries/index.tsx +++ b/src/pages/breweries/index.tsx @@ -1,7 +1,7 @@ import BreweryCard from '@/components/BreweryIndex/BreweryCard'; import LoadingCard from '@/components/ui/LoadingCard'; import Spinner from '@/components/ui/Spinner'; -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import useBreweryPosts from '@/hooks/data-fetching/brewery-posts/useBreweryPosts'; import BreweryPostQueryResult from '@/services/BreweryPost/types/BreweryPostQueryResult'; import { NextPage } from 'next'; diff --git a/src/pages/user/current.tsx b/src/pages/user/current.tsx index c5d739f..0d0f5c4 100644 --- a/src/pages/user/current.tsx +++ b/src/pages/user/current.tsx @@ -1,6 +1,6 @@ import Spinner from '@/components/ui/Spinner'; import withPageAuthRequired from '@/util/withPageAuthRequired'; -import UserContext from '@/contexts/userContext'; +import UserContext from '@/contexts/UserContext'; import { GetServerSideProps, NextPage } from 'next'; import { useContext } from 'react';