From c5b546dcf645eb214bca45de1f3496c40f274420 Mon Sep 17 00:00:00 2001 From: Aaron William Po Date: Tue, 2 May 2023 23:27:12 -0400 Subject: [PATCH] Refactor: create separate directory for beer/brewery comments --- .../CommentCardBody.tsx | 0 .../CommentCardDropdown.tsx | 0 .../CommentContentBody.tsx | 0 .../CommentLoadingCardBody.tsx | 0 .../EditCommentBody.tsx | 0 src/components/BeerById/LoadingComponent.tsx | 8 ++++---- src/components/ui/CommentsComponent.tsx | 10 +++++----- 7 files changed, 9 insertions(+), 9 deletions(-) rename src/components/{BeerById => BeerBreweryComments}/CommentCardBody.tsx (100%) rename src/components/{BeerById => BeerBreweryComments}/CommentCardDropdown.tsx (100%) rename src/components/{BeerById => BeerBreweryComments}/CommentContentBody.tsx (100%) rename src/components/{BeerById => BeerBreweryComments}/CommentLoadingCardBody.tsx (100%) rename src/components/{BeerById => BeerBreweryComments}/EditCommentBody.tsx (100%) diff --git a/src/components/BeerById/CommentCardBody.tsx b/src/components/BeerBreweryComments/CommentCardBody.tsx similarity index 100% rename from src/components/BeerById/CommentCardBody.tsx rename to src/components/BeerBreweryComments/CommentCardBody.tsx diff --git a/src/components/BeerById/CommentCardDropdown.tsx b/src/components/BeerBreweryComments/CommentCardDropdown.tsx similarity index 100% rename from src/components/BeerById/CommentCardDropdown.tsx rename to src/components/BeerBreweryComments/CommentCardDropdown.tsx diff --git a/src/components/BeerById/CommentContentBody.tsx b/src/components/BeerBreweryComments/CommentContentBody.tsx similarity index 100% rename from src/components/BeerById/CommentContentBody.tsx rename to src/components/BeerBreweryComments/CommentContentBody.tsx diff --git a/src/components/BeerById/CommentLoadingCardBody.tsx b/src/components/BeerBreweryComments/CommentLoadingCardBody.tsx similarity index 100% rename from src/components/BeerById/CommentLoadingCardBody.tsx rename to src/components/BeerBreweryComments/CommentLoadingCardBody.tsx diff --git a/src/components/BeerById/EditCommentBody.tsx b/src/components/BeerBreweryComments/EditCommentBody.tsx similarity index 100% rename from src/components/BeerById/EditCommentBody.tsx rename to src/components/BeerBreweryComments/EditCommentBody.tsx diff --git a/src/components/BeerById/LoadingComponent.tsx b/src/components/BeerById/LoadingComponent.tsx index 5e09a28..7e953f0 100644 --- a/src/components/BeerById/LoadingComponent.tsx +++ b/src/components/BeerById/LoadingComponent.tsx @@ -1,15 +1,15 @@ -import { FC } from 'react'; +import {FC} from 'react'; import Spinner from '../ui/Spinner'; -import CommentLoadingCardBody from './CommentLoadingCardBody'; +import CommentLoadingCardBody from '../BeerBreweryComments/CommentLoadingCardBody'; interface LoadingComponentProps { length: number; } -const LoadingComponent: FC = ({ length }) => { +const LoadingComponent: FC = ({length}) => { return ( <> - {Array.from({ length }).map((_, i) => ( + {Array.from({length}).map((_, i) => ( ))}
diff --git a/src/components/ui/CommentsComponent.tsx b/src/components/ui/CommentsComponent.tsx index 00c6e0b..3555c7a 100644 --- a/src/components/ui/CommentsComponent.tsx +++ b/src/components/ui/CommentsComponent.tsx @@ -1,14 +1,14 @@ -import { FC, MutableRefObject } from 'react'; -import { FaArrowUp } from 'react-icons/fa'; +import {FC, MutableRefObject} from 'react'; +import {FaArrowUp} from 'react-icons/fa'; -import { useInView } from 'react-intersection-observer'; +import {useInView} from 'react-intersection-observer'; import useBeerPostComments from '@/hooks/data-fetching/beer-comments/useBeerPostComments'; import useBreweryPostComments from '@/hooks/data-fetching/brewery-comments/useBreweryPostComments'; import NoCommentsCard from '../BeerById/NoCommentsCard'; import LoadingComponent from '../BeerById/LoadingComponent'; -import CommentCardBody from '../BeerById/CommentCardBody'; +import CommentCardBody from '../BeerBreweryComments/CommentCardBody'; interface CommentsComponentProps { commentSectionRef: MutableRefObject; @@ -41,7 +41,7 @@ const CommentsComponent: FC = ({ size, mutate, }) => { - const { ref: penultimateCommentRef } = useInView({ + const {ref: penultimateCommentRef} = useInView({ /** * When the second last comment comes into view, call setSize from useBeerPostComments * to load more comments.