diff --git a/src/api/axiosInstance.ts b/src/api/axiosInstance.ts index 376f605..0c56505 100644 --- a/src/api/axiosInstance.ts +++ b/src/api/axiosInstance.ts @@ -29,10 +29,7 @@ axiosInstance.interceptors.response.use( if (error.response?.status === 401 && !originalRequest._retry) { originalRequest._retry = true; - const refreshToken = - typeof window !== 'undefined' - ? localStorage.getItem('refreshToken') - : null; + const refreshToken = typeof window !== 'undefined' ? localStorage.getItem('refreshToken') : null; try { originalRequest.headers['Refresh-Token'] = refreshToken; diff --git a/src/components/atoms/Container.tsx b/src/components/atoms/Container.tsx index 14cf524..7c5fcc4 100644 --- a/src/components/atoms/Container.tsx +++ b/src/components/atoms/Container.tsx @@ -8,10 +8,7 @@ interface ContainerProps { const Container: React.FC = ({ children, className, id }) => { return ( -
+
{children}
); diff --git a/src/components/atoms/IngredientDateTag.tsx b/src/components/atoms/IngredientDateTag.tsx index dc11385..0d0c3cc 100644 --- a/src/components/atoms/IngredientDateTag.tsx +++ b/src/components/atoms/IngredientDateTag.tsx @@ -30,10 +30,7 @@ const IngredientDateTag: React.FC = ({ dDay }) => { } return ( -
+
{textDay}
); diff --git a/src/components/atoms/Lottie.tsx b/src/components/atoms/Lottie.tsx index 68ea74f..3cd9d57 100644 --- a/src/components/atoms/Lottie.tsx +++ b/src/components/atoms/Lottie.tsx @@ -3,15 +3,7 @@ import animationData from './../../assets/lottie.webp'; import Image from 'next/image'; const LottieComponent = () => { - return ( - 로딩중 - ); + return 로딩중; }; export default LottieComponent; diff --git a/src/components/molecules/FridgeListItem.tsx b/src/components/molecules/FridgeListItem.tsx index d8e9c2b..435ecff 100644 --- a/src/components/molecules/FridgeListItem.tsx +++ b/src/components/molecules/FridgeListItem.tsx @@ -34,10 +34,7 @@ const FridgeListItem: React.FC = ({ }; return ( - +
{isEditingFridgeName && id === newFridgeName.id ? ( { )} - +
{ingredients?.pages.map(({ content }) => content && content.length > 0 ? ( @@ -102,9 +93,7 @@ const FridgeBoard: React.FC = () => { )) ) : (
- +
), )} diff --git a/src/components/organisms/FridgeInfoBox.tsx b/src/components/organisms/FridgeInfoBox.tsx index 0aa9ab1..e2e5382 100644 --- a/src/components/organisms/FridgeInfoBox.tsx +++ b/src/components/organisms/FridgeInfoBox.tsx @@ -13,20 +13,10 @@ const FridgeInfoBox: React.FC<{ return (
-
- {userName ?? '사용자정보없음'} 님의 -
-
+
{userName ?? '사용자정보없음'} 님의
+
{name ?? '냉장고를 선택해주세요'}
- +
{isOkIngredientAdd && ( @@ -34,9 +24,7 @@ const FridgeInfoBox: React.FC<{ className="rounded-6 w-[100px] p-[10px] body1-semibold bg-primary2 text-white" text="식자재 추가" onClick={() => { - void router.push( - `/fridge/add?fridgeid=${fridgeid as string}&name=${name as string}`, - ); + void router.push(`/fridge/add?fridgeid=${fridgeid as string}&name=${name as string}`); }} /> )} diff --git a/src/components/organisms/FridgeListModal.tsx b/src/components/organisms/FridgeListModal.tsx index 1281005..9623fd2 100644 --- a/src/components/organisms/FridgeListModal.tsx +++ b/src/components/organisms/FridgeListModal.tsx @@ -29,9 +29,7 @@ const FridgeListModal: React.FC<{ const handleFridgeClick = (id: number, name: string) => { void router.push( - ownerId - ? `/friend/${ownerId}?fridgeid=${id}&name=${name}` - : `fridge/?fridgeid=${id}&name=${name}`, + ownerId ? `/friend/${ownerId}?fridgeid=${id}&name=${name}` : `fridge/?fridgeid=${id}&name=${name}`, ); onCloseFridgeListModal(); }; @@ -58,9 +56,7 @@ const FridgeListModal: React.FC<{
냉장고 목록
-
- 자유롭게 여러 냉장고를 정리할 수 있어요 -
+
자유롭게 여러 냉장고를 정리할 수 있어요
{fridgeList?.map(({ id, name }) => ( @@ -91,10 +87,7 @@ const FridgeListModal: React.FC<{
{!ownerId && ( - )} diff --git a/src/components/organisms/FriendsFridgeList.tsx b/src/components/organisms/FriendsFridgeList.tsx index 22355c9..e08e67d 100644 --- a/src/components/organisms/FriendsFridgeList.tsx +++ b/src/components/organisms/FriendsFridgeList.tsx @@ -18,30 +18,15 @@ const FriendsFridgeList: React.FC<{
친구 목록 {count}
-
+
등록순
- +
{data && data.length !== 0 ? ( - data.map((friend) => ( - - )) + data.map((friend) => ) ) : ( )} diff --git a/src/components/organisms/FriendsRecentBoard.tsx b/src/components/organisms/FriendsRecentBoard.tsx index 48e2ee7..3eb9230 100644 --- a/src/components/organisms/FriendsRecentBoard.tsx +++ b/src/components/organisms/FriendsRecentBoard.tsx @@ -4,9 +4,7 @@ import Link from 'next/link'; import type { FriendObjectType } from '@/hooks/queries/friends/useGetFriendsNews'; import Image from 'next/image'; -const FriendsRecentBoard: React.FC<{ friendNews: FriendObjectType }> = ({ - friendNews, -}) => { +const FriendsRecentBoard: React.FC<{ friendNews: FriendObjectType }> = ({ friendNews }) => { return (
최신근황
@@ -15,26 +13,14 @@ const FriendsRecentBoard: React.FC<{ friendNews: FriendObjectType }> = ({
{friendNews.friendRefrigeratorIngredientGroupList[0].name}를 추가했어요!
-
- 그밖에 신선한 재료를 구경할 수 있어요. -
+
그밖에 신선한 재료를 구경할 수 있어요.
- {friendNews.friendRefrigeratorIngredientGroupList.map( - ({ name, iconImage }) => ( -
- {`${name} -
{name}
-
- ), - )} + {friendNews.friendRefrigeratorIngredientGroupList.map(({ name, iconImage }) => ( +
+ {`${name} +
{name}
+
+ ))}
void; -}> = ({ - id, - categoryImage, - toggleIsOpenIngredientModal, - isDetailModal = false, - category, - ingredientsRefetch, -}) => { +}> = ({ id, categoryImage, toggleIsOpenIngredientModal, isDetailModal = false, category, ingredientsRefetch }) => { const router = useRouter(); const today = new Date(); @@ -53,18 +39,9 @@ const IngredientModal: React.FC<{ queryClient.invalidateQueries({ queryKey: ['my_fridge'] }); }; - const postIngredient = usePostIngredient( - onSuccess, - fridgeid as string, - name as string, - ); + const postIngredient = usePostIngredient(onSuccess, fridgeid as string, name as string); - const data = - id === 0 - ? null - : isDetailModal - ? useGetMyIngredient(id) - : useGetIngredientById(id); + const data = id === 0 ? null : isDetailModal ? useGetMyIngredient(id) : useGetIngredientById(id); const expirationDate = new Date(today); expirationDate.setDate(today.getDate() + (data?.expirationDays ?? 0)); @@ -78,28 +55,14 @@ const IngredientModal: React.FC<{ location: data?.location ?? 'FREEZING', memo: '', addDate: today, - expirationDate: data?.expirationDate - ? new Date(data?.expirationDate) - : expirationDate, + expirationDate: data?.expirationDate ? new Date(data?.expirationDate) : expirationDate, isDeleted: false, }); - const deleteIngredient = useDeleteIngredientById( - id, - Number(fridgeid), - reqBody?.location, - ingredientsRefetch, - ); - const putIngredient = usePutIngredientById( - id, - Number(fridgeid), - reqBody?.location, - ingredientsRefetch, - ); + const deleteIngredient = useDeleteIngredientById(id, Number(fridgeid), reqBody?.location, ingredientsRefetch); + const putIngredient = usePutIngredientById(id, Number(fridgeid), reqBody?.location, ingredientsRefetch); - const [isInFreezer, setIsInFreezer] = useState( - reqBody?.location === 'REFRIGERATION', - ); + const [isInFreezer, setIsInFreezer] = useState(reqBody?.location === 'REFRIGERATION'); const toggleIsInFreezer: () => void = () => { setIsInFreezer((prev) => !prev); @@ -129,12 +92,7 @@ const IngredientModal: React.FC<{
- {data?.name + {data?.name {isEditingName ? (
- } - title="소비기한" - > + } title="소비기한">
- } - title="수량" - > + } title="수량"> { @@ -210,18 +160,10 @@ const IngredientModal: React.FC<{ }} /> - } - title="냉동보관" - > + } title="냉동보관"> - } - title="메모" - > + } title="메모"> ) => { @@ -261,11 +203,7 @@ const IngredientModal: React.FC<{ />
) : ( -
diff --git a/src/components/organisms/ShareListItem.tsx b/src/components/organisms/ShareListItem.tsx index a8fe0b0..3242b0c 100644 --- a/src/components/organisms/ShareListItem.tsx +++ b/src/components/organisms/ShareListItem.tsx @@ -15,34 +15,18 @@ const ShareListItem: React.FC<{ className="flex flex-1 items-center mb-[12px] pl-[18px] pr-[12px] py-[16px] rounded-[12px] bg-white" > {data.thumbnailImage ? ( - thumbnail + thumbnail ) : (
)}

{data.title}

- +

{data.location} - + {`${dayjs(data.shareDate).format('MM월 DD일')} ${data.shareTime.slice(0, 5)}`}

diff --git a/src/components/templates/AddFriendTemplate.tsx b/src/components/templates/AddFriendTemplate.tsx index d4466fc..6ccd3cc 100644 --- a/src/components/templates/AddFriendTemplate.tsx +++ b/src/components/templates/AddFriendTemplate.tsx @@ -1,9 +1,6 @@ import { LabelRoundBox, WarningLine } from '@/components/molecules'; import React, { useState } from 'react'; -import { - useAddFriendship, - useGetMyInviteCode, -} from '@/hooks/queries/friendship'; +import { useAddFriendship, useGetMyInviteCode } from '@/hooks/queries/friendship'; import { BulletNoticeBox } from '@/components/organisms'; import { MiniButton } from '@/components/atoms'; @@ -68,15 +65,9 @@ const AddFriendTemplate: React.FC = () => { }} maxLength={10} /> - +
- {warningVisible ? ( - - ) : null} + {warningVisible ? : null} } /> diff --git a/src/hooks/queries/fridge/useDeleteIngredientById.ts b/src/hooks/queries/fridge/useDeleteIngredientById.ts index e36bcc1..2230016 100644 --- a/src/hooks/queries/fridge/useDeleteIngredientById.ts +++ b/src/hooks/queries/fridge/useDeleteIngredientById.ts @@ -2,22 +2,12 @@ import { queryClient } from '@/pages/_app'; import { queryKeys } from '../queryKeys'; import { useBaseMutation } from '../useBaseMutation'; -const useDeleteIngredientById = ( - id: number, - fridgeId: number, - location: string, - fn?: () => void, -) => { +const useDeleteIngredientById = (id: number, fridgeId: number, location: string, fn?: () => void) => { const onSuccess = () => { void queryClient.invalidateQueries(); if (fn) fn(); }; - return useBaseMutation( - queryKeys.MY_FRIDGE_CONTENT(fridgeId, location), - `/ingrs/detail/${id}`, - onSuccess, - 'DELETE', - ); + return useBaseMutation(queryKeys.MY_FRIDGE_CONTENT(fridgeId, location), `/ingrs/detail/${id}`, onSuccess, 'DELETE'); }; export default useDeleteIngredientById; diff --git a/src/hooks/queries/fridge/useGetFridgeList.ts b/src/hooks/queries/fridge/useGetFridgeList.ts index 2de3a7e..a4bf3cf 100644 --- a/src/hooks/queries/fridge/useGetFridgeList.ts +++ b/src/hooks/queries/fridge/useGetFridgeList.ts @@ -7,10 +7,7 @@ interface IngredientType { } const useGetMyFridgeList = (id?: number) => { - const { data } = useBaseQuery( - queryKeys.MY_FRIDGE_LIST(), - `/refrigs/${id ? `users/${id}` : 'my'}`, - ); + const { data } = useBaseQuery(queryKeys.MY_FRIDGE_LIST(), `/refrigs/${id ? `users/${id}` : 'my'}`); return data?.data; }; diff --git a/src/hooks/queries/fridge/useGetIngredientById.ts b/src/hooks/queries/fridge/useGetIngredientById.ts index 1b9aef4..3891606 100644 --- a/src/hooks/queries/fridge/useGetIngredientById.ts +++ b/src/hooks/queries/fridge/useGetIngredientById.ts @@ -14,10 +14,7 @@ export interface IngredientType { } const useGetIngredientById = (id: number) => { - const { data } = useBaseQuery( - queryKeys.INGREDIENT_ID(id), - `/ingrs/${id}`, - ); + const { data } = useBaseQuery(queryKeys.INGREDIENT_ID(id), `/ingrs/${id}`); if (!data?.data) return; diff --git a/src/hooks/queries/fridge/useGetMyIngredient.ts b/src/hooks/queries/fridge/useGetMyIngredient.ts index b634dbf..cebd76b 100644 --- a/src/hooks/queries/fridge/useGetMyIngredient.ts +++ b/src/hooks/queries/fridge/useGetMyIngredient.ts @@ -3,10 +3,7 @@ import { useBaseQuery } from '../useBaseQuery'; import type { IngredientType } from './useGetIngredientById'; const useGetMyIngredient = (id: number) => { - const { data } = useBaseQuery( - queryKeys.MY_INGREDIENT_ID(id), - `/ingrs/detail/${id}`, - ); + const { data } = useBaseQuery(queryKeys.MY_INGREDIENT_ID(id), `/ingrs/detail/${id}`); return data?.data; }; diff --git a/src/hooks/queries/fridge/usePostFridge.ts b/src/hooks/queries/fridge/usePostFridge.ts index 131831b..d7ff09c 100644 --- a/src/hooks/queries/fridge/usePostFridge.ts +++ b/src/hooks/queries/fridge/usePostFridge.ts @@ -10,11 +10,7 @@ const usePostFridge = () => { const onSuccess = (data: PostFridgeBodyType) => { void queryClient.invalidateQueries(); }; - return useBaseMutation( - queryKeys.INGREDIENT_LIST, - `/refrigs`, - onSuccess, - ); + return useBaseMutation(queryKeys.INGREDIENT_LIST, `/refrigs`, onSuccess); }; export default usePostFridge; diff --git a/src/hooks/queries/fridge/usePostIngredient.ts b/src/hooks/queries/fridge/usePostIngredient.ts index 1214888..3a9fb51 100644 --- a/src/hooks/queries/fridge/usePostIngredient.ts +++ b/src/hooks/queries/fridge/usePostIngredient.ts @@ -20,10 +20,6 @@ const usePostIngredient = (fn: () => void, fridgeid: string, name: string) => { void router.push(`/fridge?fridgeid=${fridgeid}&name=${name}`); fn(); }; - return useBaseMutation( - queryKeys.INGREDIENTS(), - `/ingrs/detail`, - onSuccess, - ); + return useBaseMutation(queryKeys.INGREDIENTS(), `/ingrs/detail`, onSuccess); }; export default usePostIngredient; diff --git a/src/hooks/queries/fridge/usePostNewIngredient.ts b/src/hooks/queries/fridge/usePostNewIngredient.ts index 0973806..a27ca06 100644 --- a/src/hooks/queries/fridge/usePostNewIngredient.ts +++ b/src/hooks/queries/fridge/usePostNewIngredient.ts @@ -9,9 +9,6 @@ export interface PostNewIngredientBodyType { } const usePostNewIngredient = () => { - return useBaseMutation( - queryKeys.INGREDIENTS(), - `/ingrs`, - ); + return useBaseMutation(queryKeys.INGREDIENTS(), `/ingrs`); }; export default usePostNewIngredient; diff --git a/src/hooks/queries/fridge/usePutIngredientById.ts b/src/hooks/queries/fridge/usePutIngredientById.ts index b5ab0fe..d1ec65f 100644 --- a/src/hooks/queries/fridge/usePutIngredientById.ts +++ b/src/hooks/queries/fridge/usePutIngredientById.ts @@ -13,21 +13,13 @@ export interface FridgeBodyType { isDeleted: boolean; } -const usePutIngredientById = ( - id: number, - fridgeId: number, - location: string, - fn?: () => void, -) => { +const usePutIngredientById = (id: number, fridgeId: number, location: string, fn?: () => void) => { const onSuccess = () => { void queryClient.invalidateQueries(); if (fn) fn(); }; return useBaseMutation( - [ - ...queryKeys.MY_FRIDGE_CONTENT(fridgeId, location), - ...queryKeys.MY_INGREDIENT_ID(id), - ], + [...queryKeys.MY_FRIDGE_CONTENT(fridgeId, location), ...queryKeys.MY_INGREDIENT_ID(id)], `/ingrs/detail/${id}`, onSuccess, 'PUT', diff --git a/src/hooks/queries/friends/useGetFriendsNews.ts b/src/hooks/queries/friends/useGetFriendsNews.ts index 7fd661a..5be02df 100644 --- a/src/hooks/queries/friends/useGetFriendsNews.ts +++ b/src/hooks/queries/friends/useGetFriendsNews.ts @@ -10,10 +10,7 @@ export interface FriendObjectType { } const useGetFriendsNews = () => { - const { data } = useBaseQuery( - queryKeys.MY_FRIENDS_NEWS(), - `friend-refrigs/recent`, - ); + const { data } = useBaseQuery(queryKeys.MY_FRIENDS_NEWS(), `friend-refrigs/recent`); return data?.data; }; diff --git a/src/hooks/queries/home/useGetMyIngredientSummary.ts b/src/hooks/queries/home/useGetMyIngredientSummary.ts index bd16f85..34d7521 100644 --- a/src/hooks/queries/home/useGetMyIngredientSummary.ts +++ b/src/hooks/queries/home/useGetMyIngredientSummary.ts @@ -3,10 +3,7 @@ import { queryKeys } from '../queryKeys'; import { useBaseQuery } from '../useBaseQuery'; const useGetMyIngredientSummary = () => { - const { data } = useBaseQuery( - queryKeys.INGREDIENTS_RECENT(), - '/ingrs/detail/recent', - ); + const { data } = useBaseQuery(queryKeys.INGREDIENTS_RECENT(), '/ingrs/detail/recent'); return data?.data; }; diff --git a/src/hooks/queries/login/usePostUser.ts b/src/hooks/queries/login/usePostUser.ts index 9443d34..7166e67 100644 --- a/src/hooks/queries/login/usePostUser.ts +++ b/src/hooks/queries/login/usePostUser.ts @@ -26,10 +26,6 @@ const usePostUser = () => { localStorage.setItem('refreshToken', data.refreshToken); void router.push('/home'); }; - return useBaseMutation( - queryKeys.KAKAO(), - `/users`, - onSuccess, - ); + return useBaseMutation(queryKeys.KAKAO(), `/users`, onSuccess); }; export default usePostUser; diff --git a/src/hooks/queries/mypage/useGetMyIngredientsCount.ts b/src/hooks/queries/mypage/useGetMyIngredientsCount.ts index b38d558..34f3e1f 100644 --- a/src/hooks/queries/mypage/useGetMyIngredientsCount.ts +++ b/src/hooks/queries/mypage/useGetMyIngredientsCount.ts @@ -2,11 +2,7 @@ import { queryKeys } from '../queryKeys'; import { useBaseQuery } from '../useBaseQuery'; const useGetMyIngredientsCount = () => { - const { data } = useBaseQuery( - queryKeys.MY_INGREDIENTS_COUNT(), - `/ingrs/detail/count?day=7`, - true, - ); + const { data } = useBaseQuery(queryKeys.MY_INGREDIENTS_COUNT(), `/ingrs/detail/count?day=7`, true); return data?.data; }; diff --git a/src/hooks/queries/mypage/useGetMyShares.ts b/src/hooks/queries/mypage/useGetMyShares.ts index 9f0bae3..27a3091 100644 --- a/src/hooks/queries/mypage/useGetMyShares.ts +++ b/src/hooks/queries/mypage/useGetMyShares.ts @@ -4,13 +4,7 @@ import type { ShareData } from '@/types/share'; import { queryKeys } from '../queryKeys'; import { useBaseInfiniteQuery } from '../useBaseInfiniteQuery'; -const useGetMyShares = ({ - sort, - status, -}: { - sort: ShareSortType; - status: ShareStatusType; -}) => +const useGetMyShares = ({ sort, status }: { sort: ShareSortType; status: ShareStatusType }) => useBaseInfiniteQuery({ queryKey: queryKeys.MY_SHARES(sort, status), url: `/shares/created`, diff --git a/src/hooks/queries/mypage/usePutMe.ts b/src/hooks/queries/mypage/usePutMe.ts index 8429653..38be55f 100644 --- a/src/hooks/queries/mypage/usePutMe.ts +++ b/src/hooks/queries/mypage/usePutMe.ts @@ -15,11 +15,6 @@ const usePutMe = () => { void queryClient.invalidateQueries(); router.push('/mypage'); }; - return useBaseMutation( - queryKeys.ME(), - `/users`, - onSuccess, - 'PUT', - ); + return useBaseMutation(queryKeys.ME(), `/users`, onSuccess, 'PUT'); }; export default usePutMe; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 9d73b61..95c2200 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -3,11 +3,7 @@ import Layout from '@/components/templates/Layout'; import '@/styles/globals.css'; import type { AppProps } from 'next/app'; import { RecoilRoot } from 'recoil'; -import { - QueryClient, - QueryClientProvider, - QueryErrorResetBoundary, -} from '@tanstack/react-query'; +import { QueryClient, QueryClientProvider, QueryErrorResetBoundary } from '@tanstack/react-query'; import React from 'react'; import 'dayjs/locale/ko'; import dayjs from 'dayjs'; diff --git a/src/pages/fridge/add/index.tsx b/src/pages/fridge/add/index.tsx index e912db3..c236e9b 100644 --- a/src/pages/fridge/add/index.tsx +++ b/src/pages/fridge/add/index.tsx @@ -4,13 +4,7 @@ import { Container } from '../../../components/atoms'; import { useRef, useState } from 'react'; import { useGetIngredientList } from '@/hooks/queries/fridge'; import Image from 'next/image'; -import { - Modal, - ModalOverlay, - ModalBody, - ModalContent, - useDisclosure, -} from '@chakra-ui/react'; +import { Modal, ModalOverlay, ModalBody, ModalContent, useDisclosure } from '@chakra-ui/react'; import Draggable from 'react-draggable'; import type { DraggableEvent } from 'react-draggable'; @@ -64,10 +58,7 @@ const FridgePage: NextPage = () => { const containerWidth = 1400; const maxScrollX = containerWidth - window.innerWidth; - const handleDrag = ( - e: DraggableEvent, - { deltaX }: { deltaX: number }, - ): void => { + const handleDrag = (e: DraggableEvent, { deltaX }: { deltaX: number }): void => { const newScrollX = scrollX - deltaX; if (newScrollX > maxScrollX) { setScrollX(maxScrollX); @@ -109,62 +100,43 @@ const FridgePage: NextPage = () => { )}
-
+
-
- {['전체', ...(data?.map((item) => item.category) ?? [])].map( - (category) => ( -
{ - handleCategoryClick(category); - }} - className={`${category === currentCategory ? 'bg-primary2 text-white' : 'bg-white text-gray4'} cursor-pointer body1-semibold pt-[6px] pb-[6px] pl-[18px] pr-[18px] rounded-[20px]`} - style={{ whiteSpace: 'nowrap' }} - data-category={category} - > - {category} -
- ), - )} +
+ {['전체', ...(data?.map((item) => item.category) ?? [])].map((category) => ( +
{ + handleCategoryClick(category); + }} + className={`${category === currentCategory ? 'bg-primary2 text-white' : 'bg-white text-gray4'} cursor-pointer body1-semibold pt-[6px] pb-[6px] pl-[18px] pr-[18px] rounded-[20px]`} + style={{ whiteSpace: 'nowrap' }} + data-category={category} + > + {category} +
+ ))}
{data?.map((items) => ( - +
    - {items.ingredientGroupList - .slice(0, CATEGORY_COUNT[items.category]) - .map((item) => ( -
  • { - setIngredientId(item.id); - onOpenIngredientModal(); - }} - className="flex flex-col items-center" - > - {item.name} -
    {item.name}
    -
  • - ))} + {items.ingredientGroupList.slice(0, CATEGORY_COUNT[items.category]).map((item) => ( +
  • { + setIngredientId(item.id); + onOpenIngredientModal(); + }} + className="flex flex-col items-center" + > + {item.name} +
    {item.name}
    +
  • + ))}
  • { @@ -175,12 +147,7 @@ const FridgePage: NextPage = () => { }} className="flex flex-col items-center" > - {items.category} + {items.category}
    직접 추가
diff --git a/src/pages/fridge/index.tsx b/src/pages/fridge/index.tsx index 2f44a6d..b2aa6de 100644 --- a/src/pages/fridge/index.tsx +++ b/src/pages/fridge/index.tsx @@ -1,17 +1,7 @@ import Header from '@/components/organisms/Header'; -import { - FridgeBoard, - FridgeInfoBox, - FridgeListModal, -} from '@/components/organisms'; +import { FridgeBoard, FridgeInfoBox, FridgeListModal } from '@/components/organisms'; import { type NextPage } from 'next'; -import { - Modal, - ModalOverlay, - ModalBody, - ModalContent, - useDisclosure, -} from '@chakra-ui/react'; +import { Modal, ModalOverlay, ModalBody, ModalContent, useDisclosure } from '@chakra-ui/react'; import { useGetMe } from '@/hooks/queries/mypage'; import { useRouter } from 'next/router'; import { useEffect } from 'react'; @@ -61,9 +51,7 @@ const FridgePage: NextPage = () => {
-
+
{ @@ -50,22 +40,14 @@ const FriendIdPage: NextPage = () => { margin={0} > - +
-
- +
+
diff --git a/src/pages/friends/index.tsx b/src/pages/friends/index.tsx index b95d809..9e33ef3 100644 --- a/src/pages/friends/index.tsx +++ b/src/pages/friends/index.tsx @@ -1,17 +1,7 @@ -import { - FriendsFridgeList, - FriendsRecentBoard, - OrderListModal, -} from '@/components/organisms'; +import { FriendsFridgeList, FriendsRecentBoard, OrderListModal } from '@/components/organisms'; import Header from '@/components/organisms/Header'; import { useGetFriendsNews } from '@/hooks/queries/friends'; -import { - Modal, - ModalBody, - ModalContent, - ModalOverlay, - useDisclosure, -} from '@chakra-ui/react'; +import { Modal, ModalBody, ModalContent, ModalOverlay, useDisclosure } from '@chakra-ui/react'; import { type NextPage } from 'next'; import { Swiper, SwiperSlide } from 'swiper/react'; import 'swiper/css'; @@ -69,9 +59,7 @@ const FriendsPage: NextPage = () => { /> } /> -
+
{friendsNewsList && friendsNewsList.length !== 0 ? ( {friendsNewsList.map((friendNews) => ( @@ -85,9 +73,7 @@ const FriendsPage: NextPage = () => { )} - +
diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 8b13e8e..24959d5 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -25,28 +25,14 @@ const Home: NextPage = () => {
} /> -
- {!!ingredientCount && ( - - )} +
+ {!!ingredientCount && }
- } - text="내 냉장고" - linkTo="/fridge" - /> - } - text="친구 냉장고" - linkTo="/friends" - /> + } text="내 냉장고" linkTo="/fridge" /> + } text="친구 냉장고" linkTo="/friends" />
-
- 소비기한 -
+
소비기한
diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 72f656c..fded3c2 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -30,22 +30,16 @@ const LoginPage: NextPage = () => { } return ( -
+
-
- 냉장고 관리, 얼른 시작해봐요 -
+
냉장고 관리, 얼른 시작해봐요
-
- SNS 계정으로 로그인 -
+
SNS 계정으로 로그인
diff --git a/src/pages/mypage/account/index.tsx b/src/pages/mypage/account/index.tsx index 9f9e04c..2218387 100644 --- a/src/pages/mypage/account/index.tsx +++ b/src/pages/mypage/account/index.tsx @@ -10,14 +10,10 @@ const FriendsListPage: NextPage = () => { return (
-
+
연결된계정
-
- {data.kakaoEmail ?? data.googleEmail ?? ''} -
+
{data.kakaoEmail ?? data.googleEmail ?? ''}
diff --git a/src/pages/mypage/profile/index.tsx b/src/pages/mypage/profile/index.tsx index 9d70ce1..fd38116 100644 --- a/src/pages/mypage/profile/index.tsx +++ b/src/pages/mypage/profile/index.tsx @@ -35,20 +35,14 @@ const ProfilePage: NextPage = () => { const [selectedProfile, setSelectedProfile] = useState('BLUE'); const [nickname, setNickname] = useState(MyInfo?.nickname ?? ''); - const [isNicknameAvailable, setIsNicknameAvailable] = useState< - null | boolean - >(null); - const [isNicknameChecked, setIsNicknameChecked] = useState( - null, - ); + const [isNicknameAvailable, setIsNicknameAvailable] = useState(null); + const [isNicknameChecked, setIsNicknameChecked] = useState(null); const putMe = usePutMe(); const postUser = usePostUser(); - const handleNicknameChange: ( - e: React.ChangeEvent, - ) => void = (e) => { + const handleNicknameChange: (e: React.ChangeEvent) => void = (e) => { setNickname(e.target.value); setIsNicknameChecked(false); void debouncedHandleNicknameChange(e.target.value); @@ -84,10 +78,7 @@ const ProfilePage: NextPage = () => { const handleSumbit = (e: FormEvent) => { e.preventDefault(); - const urlParams = - typeof window !== 'undefined' - ? new URLSearchParams(window.location.search) - : null; + const urlParams = typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : null; const kakaoId = urlParams?.get('kakaoId'); const kakaoEmail = urlParams?.get('kakaoEmail'); @@ -107,9 +98,7 @@ const ProfilePage: NextPage = () => { return (
-
+
{ width={120} height={120} /> -
+
- +
{isNicknameChecked && (isNicknameAvailable ? ( - - 사용가능한 닉네임입니다. - + 사용가능한 닉네임입니다. ) : ( - + ))}
{PROFILES.map(({ string, pointColor }) => ( 프로필 이미지 {
{data?.pages.map((page) => - page.content.map((ele: ShareData) => ( - - )), + page.content.map((ele: ShareData) => ), )} {isFetchingNextPage ? :
}
- + { )}
-

- {MOCK_DATA_IS_AUTHOR ? '나의 나눔' : data?.userName} -

-

- {data?.title} -

+

{MOCK_DATA_IS_AUTHOR ? '나의 나눔' : data?.userName}

+

{data?.title}

- +
- +
0 ? dayjs(data?.limitDate).diff(dayjs(), 'day') : 0}`} />
- - - + + +
@@ -103,11 +81,7 @@ const ShareDetailPage: NextPage = () => {
{MOCK_DATA_IS_AUTHOR ? ( - + ) : (