{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 }) => (
-
- ),
- )}
+ {friendNews.friendRefrigeratorIngredientGroupList.map(({ name, iconImage }) => (
+
+ ))}
{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}
-
- ))}
+ {items.ingredientGroupList.slice(0, CATEGORY_COUNT[items.category]).map((item) => (
+ - {
+ setIngredientId(item.id);
+ onOpenIngredientModal();
+ }}
+ className="flex flex-col items-center"
+ >
+
+
{item.name}
+
+ ))}
- {
@@ -175,12 +147,7 @@ const FridgePage: NextPage = () => {
}}
className="flex flex-col items-center"
>
-
+
직접 추가
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 ?? ''}