mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor: change directory structure of hooks to organize by task
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import UserContext from '@/contexts/userContext';
|
||||
import useUser from '@/hooks/useUser';
|
||||
|
||||
import '@/styles/globals.css';
|
||||
import type { AppProps } from 'next/app';
|
||||
import { useEffect } from 'react';
|
||||
@@ -10,6 +10,7 @@ import { Analytics } from '@vercel/analytics/react';
|
||||
import { Space_Grotesk } from 'next/font/google';
|
||||
import Head from 'next/head';
|
||||
import Layout from '@/components/ui/Layout';
|
||||
import useUser from '@/hooks/auth/useUser';
|
||||
|
||||
const spaceGrotesk = Space_Grotesk({
|
||||
subsets: ['latin'],
|
||||
|
||||
@@ -16,7 +16,7 @@ import { z } from 'zod';
|
||||
|
||||
import 'react-responsive-carousel/lib/styles/carousel.min.css';
|
||||
import { Carousel } from 'react-responsive-carousel';
|
||||
import useMediaQuery from '@/hooks/useMediaQuery';
|
||||
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
|
||||
import { Tab } from '@headlessui/react';
|
||||
|
||||
interface BeerPageProps {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { MutableRefObject, useContext, useRef } from 'react';
|
||||
import { useInView } from 'react-intersection-observer';
|
||||
import Spinner from '@/components/ui/Spinner';
|
||||
|
||||
import useBeerPosts from '@/hooks/useBeerPosts';
|
||||
import useBeerPosts from '@/hooks/data-fetching/beer-posts/useBeerPosts';
|
||||
import { FaArrowUp, FaPlus } from 'react-icons/fa';
|
||||
import LoadingCard from '@/components/ui/LoadingCard';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ChangeEvent, useEffect, useState } from 'react';
|
||||
import Spinner from '@/components/ui/Spinner';
|
||||
|
||||
import debounce from 'lodash/debounce';
|
||||
import useBeerPostSearch from '@/hooks/useBeerPostSearch';
|
||||
import useBeerPostSearch from '@/hooks/data-fetching/beer-posts/useBeerPostSearch';
|
||||
import FormLabel from '@/components/ui/forms/FormLabel';
|
||||
|
||||
const DEBOUNCE_DELAY = 300;
|
||||
|
||||
@@ -7,7 +7,7 @@ import Head from 'next/head';
|
||||
import Image from 'next/image';
|
||||
import 'react-responsive-carousel/lib/styles/carousel.min.css'; // requires a loader
|
||||
import { Carousel } from 'react-responsive-carousel';
|
||||
import useMediaQuery from '@/hooks/useMediaQuery';
|
||||
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
|
||||
import { Tab } from '@headlessui/react';
|
||||
import BreweryInfoHeader from '@/components/BreweryById/BreweryInfoHeader';
|
||||
import BreweryPostMap from '@/components/BreweryById/BreweryPostMap';
|
||||
|
||||
@@ -2,7 +2,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 useBreweryPosts from '@/hooks/useBreweryPosts';
|
||||
import useBreweryPosts from '@/hooks/data-fetching/brewery-posts/useBreweryPosts';
|
||||
import BreweryPostQueryResult from '@/services/BreweryPost/types/BreweryPostQueryResult';
|
||||
import { NextPage } from 'next';
|
||||
import Head from 'next/head';
|
||||
|
||||
@@ -13,7 +13,7 @@ import DBClient from '@/prisma/DBClient';
|
||||
import LocationMarker from '@/components/ui/LocationMarker';
|
||||
import Link from 'next/link';
|
||||
import Head from 'next/head';
|
||||
import useGeolocation from '@/hooks/useGeolocation';
|
||||
import useGeolocation from '@/hooks/utilities/useGeolocation';
|
||||
|
||||
type MapStyles = Record<'light' | 'dark', `mapbox://styles/mapbox/${string}`>;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FaUserCircle } from 'react-icons/fa';
|
||||
import Head from 'next/head';
|
||||
import Link from 'next/link';
|
||||
|
||||
import useRedirectWhenLoggedIn from '@/hooks/useRedirectIfLoggedIn';
|
||||
import useRedirectWhenLoggedIn from '@/hooks/auth/useRedirectIfLoggedIn';
|
||||
|
||||
const LoginPage: NextPage = () => {
|
||||
useRedirectWhenLoggedIn();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import RegisterUserForm from '@/components/RegisterUserForm';
|
||||
import FormPageLayout from '@/components/ui/forms/FormPageLayout';
|
||||
|
||||
import useRedirectWhenLoggedIn from '@/hooks/useRedirectIfLoggedIn';
|
||||
import useRedirectWhenLoggedIn from '@/hooks/auth/useRedirectIfLoggedIn';
|
||||
import { NextPage } from 'next';
|
||||
import Head from 'next/head';
|
||||
import { BiUser } from 'react-icons/bi';
|
||||
|
||||
@@ -4,7 +4,7 @@ import UserContext from '@/contexts/userContext';
|
||||
|
||||
import { GetServerSideProps, NextPage } from 'next';
|
||||
import { useContext } from 'react';
|
||||
import useMediaQuery from '@/hooks/useMediaQuery';
|
||||
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
|
||||
|
||||
const ProtectedPage: NextPage = () => {
|
||||
const { user, isLoading } = useContext(UserContext);
|
||||
|
||||
Reference in New Issue
Block a user