([]);
-
- useEffect(() => {
- setStatus("loading");
-
- fetch("https://jsonplaceholder.typicode.com/posts")
- .then((res) => {
- if (!res.ok) {
- throw new Error(res.statusText);
- }
- return res;
- })
- .then((res) => res.json())
- .then((data) => {
- setStatus("success");
- setData(data);
- })
- .catch(() => {
- setStatus("error");
- });
- }, []);
-
- return {
- status,
- data,
- };
-}
-
-export const PostList = () => {
- const { status, data: posts } = useFetchPostList();
-
- if (status === "loading") {
- return Fetching Star Wars data...
;
- }
-
- if (status === "error") {
- return Could not fetch Star Wars data
;
- }
- return (
-
- {posts.map((post) => (
-
- ))}
-
- );
-};
diff --git a/src/components/explore/EmptyMemesView/index.ts b/src/components/explore/EmptyMemesView/index.ts
deleted file mode 100644
index d7d91c38..00000000
--- a/src/components/explore/EmptyMemesView/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./EmptyMemesView";
diff --git a/src/components/explore/MemesByTag/index.ts b/src/components/explore/MemesByTag/index.ts
deleted file mode 100644
index 69c35de0..00000000
--- a/src/components/explore/MemesByTag/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./MemesByTag";
diff --git a/src/components/explore/Thumbnail/index.ts b/src/components/explore/Thumbnail/index.ts
deleted file mode 100644
index d376b7af..00000000
--- a/src/components/explore/Thumbnail/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./Thumbnail";
diff --git a/src/components/explore/index.ts b/src/components/explore/index.ts
deleted file mode 100644
index d415b828..00000000
--- a/src/components/explore/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from "./EmptyMemesView";
-export * from "./MemesByKeyword";
-export * from "./MemesByTag";
-export * from "./Thumbnail";
diff --git a/src/components/home/MemeListContainer/DropDown/index.ts b/src/components/home/MemeListContainer/DropDown/index.ts
deleted file mode 100644
index 859f7da0..00000000
--- a/src/components/home/MemeListContainer/DropDown/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./MemeSortDropDown";
diff --git a/src/components/home/MemeListContainer/MemeList/UserFindMemeList.tsx b/src/components/home/MemeListContainer/MemeList/UserFindMemeList.tsx
deleted file mode 100644
index 86082981..00000000
--- a/src/components/home/MemeListContainer/MemeList/UserFindMemeList.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { useGetUserFindMemes } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
-
-interface Props {
- userId: number | undefined;
-}
-
-export const UserFindMemeList = ({ userId }: Props) => {
- const {
- data: memeList,
- isFetchingNextPage,
- fetchNextPage,
- } = useGetUserFindMemes({
- userId: userId as number,
- });
-
- return (
- fetchNextPage({ cancelRefetch: false })}
- />
- );
-};
diff --git a/src/components/home/MemeListContainer/MemeList/index.ts b/src/components/home/MemeListContainer/MemeList/index.ts
deleted file mode 100644
index ed83a373..00000000
--- a/src/components/home/MemeListContainer/MemeList/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./CommonMemeList";
-export * from "./UserFindMemeList";
diff --git a/src/components/home/Skeleton/SkeletonMeme.tsx b/src/components/home/Skeleton/SkeletonMeme.tsx
deleted file mode 100644
index da59cfe9..00000000
--- a/src/components/home/Skeleton/SkeletonMeme.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { Skeleton } from "@/components/common/Skeleton";
-
-import { SkeletonTagList } from "./SkeletonTagList";
-
-export const SkeletonMeme = () => {
- return (
-
- );
-};
diff --git a/src/components/home/Skeleton/SkeletonTagList.tsx b/src/components/home/Skeleton/SkeletonTagList.tsx
deleted file mode 100644
index f2466b12..00000000
--- a/src/components/home/Skeleton/SkeletonTagList.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Skeleton } from "@/components/common/Skeleton";
-
-export const SkeletonTagList = ({ count }: { count: number }) => {
- return (
-
- {Array.from(Array(count).keys()).map((i) => (
-
- ))}
-
- );
-};
diff --git a/src/components/home/Skeleton/index.ts b/src/components/home/Skeleton/index.ts
deleted file mode 100644
index 19129f4d..00000000
--- a/src/components/home/Skeleton/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./SkeletonMeme";
-export * from "./SkeletonTagList";
diff --git a/src/components/home/UserSharedMeme/SharedMemeItem.tsx b/src/components/home/UserSharedMeme/SharedMemeItem.tsx
deleted file mode 100644
index 6bdc1f34..00000000
--- a/src/components/home/UserSharedMeme/SharedMemeItem.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import Link from "next/link";
-
-import { Icon } from "@/components/common/Icon";
-import { Photo } from "@/components/common/Photo";
-import { SSRSuspense } from "@/components/common/Suspense";
-import type { Meme } from "@/types";
-
-import { SkeletonTagList } from "../Skeleton";
-import { SharedMemeTagList } from "./SharedMemeTagList";
-
-interface Props {
- meme: Meme;
-}
-
-export const SharedMemeItem = ({ meme }: Props) => {
- return (
-
-
-
-
- {meme.name}
-
-
- {meme.shareCount}
-
-
-
- }>
-
-
-
- );
-};
diff --git a/src/components/home/UserSharedMeme/SharedMemeTagList.tsx b/src/components/home/UserSharedMeme/SharedMemeTagList.tsx
deleted file mode 100644
index 2bf0bc2b..00000000
--- a/src/components/home/UserSharedMeme/SharedMemeTagList.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import Link from "next/link";
-
-import { useGetMemeTagsById } from "@/application/hooks";
-import { PATH } from "@/application/util";
-import { Chip } from "@/components/common/Chip";
-
-interface Props {
- id: string;
-}
-
-export const SharedMemeTagList = ({ id }: Props) => {
- const { tags } = useGetMemeTagsById(id);
-
- return (
-
- {tags?.slice(0, 3)?.map((tag) => (
- -
-
-
-
-
- ))}
-
- );
-};
diff --git a/src/components/home/UserSharedMeme/UserSharedMemeList.tsx b/src/components/home/UserSharedMeme/UserSharedMemeList.tsx
deleted file mode 100644
index d8a6b3ee..00000000
--- a/src/components/home/UserSharedMeme/UserSharedMemeList.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import Link from "next/link";
-import { css } from "twin.macro";
-
-import { useGetMemesByCollectionId } from "@/application/hooks";
-import { Icon } from "@/components/common/Icon";
-
-import { SharedMemeItem } from "./SharedMemeItem";
-
-interface Props {
- name?: string;
- sharedId?: number;
-}
-export const UserSharedMemeList = ({ name, sharedId }: Props) => {
- const { data: memeList } = useGetMemesByCollectionId(sharedId as number);
- if (!memeList.length) return null;
-
- return (
-
-
-
- {`${name} 이(가) 공유했던 밈`}
-
-
-
-
- {memeList.map((meme) => (
-
- ))}
-
-
- );
-};
diff --git a/src/components/home/UserSharedMeme/index.ts b/src/components/home/UserSharedMeme/index.ts
deleted file mode 100644
index 70d508d6..00000000
--- a/src/components/home/UserSharedMeme/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./UserSharedMemeList";
diff --git a/src/components/meme/ActionSheet/index.ts b/src/components/meme/ActionSheet/index.ts
deleted file mode 100644
index 9248829a..00000000
--- a/src/components/meme/ActionSheet/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./MemeActionSheet";
diff --git a/src/components/meme/InfiniteMemeList/index.ts b/src/components/meme/InfiniteMemeList/index.ts
deleted file mode 100644
index 435c2149..00000000
--- a/src/components/meme/InfiniteMemeList/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./InfiniteMemeList";
diff --git a/src/components/meme/MemeInfo/Button/CollectionSaveButton.tsx b/src/components/meme/MemeInfo/Button/CollectionSaveButton.tsx
deleted file mode 100644
index a6825692..00000000
--- a/src/components/meme/MemeInfo/Button/CollectionSaveButton.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { useAuth, useCollection } from "@/application/hooks";
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
-
-interface Props {
- id: string;
-}
-
-export const CollectionSaveButton = ({ id }: Props) => {
- const { validate, isLogin } = useAuth();
- const { isAdded, onUpdateCollection } = useCollection({ memeId: Number(id), isLogin });
-
- return (
-
- );
-};
diff --git a/src/components/meme/MemeInfo/Button/index.ts b/src/components/meme/MemeInfo/Button/index.ts
deleted file mode 100644
index bc1b9427..00000000
--- a/src/components/meme/MemeInfo/Button/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from "./ClipboardCopyButton";
-export * from "./CollectionSaveButton";
-export * from "./KakaoShareButton";
-export * from "./NativeShareButton";
diff --git a/src/components/meme/MemeInfo/MemeCTAList.tsx b/src/components/meme/MemeInfo/MemeCTAList.tsx
deleted file mode 100644
index 44aa52ae..00000000
--- a/src/components/meme/MemeInfo/MemeCTAList.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Suspense } from "react";
-
-import { useOverlay } from "@/application/hooks";
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
-import { MemeShareModal } from "@/components/meme/MemeInfo/Modal";
-
-import { CollectionSaveButton } from "./Button";
-
-interface Props {
- id: string;
-}
-
-export const MemeCTAList = ({ id }: Props) => {
- const overlay = useOverlay();
-
- return (
-
-
-
-
-
- );
-};
diff --git a/src/components/meme/MemeInfo/Skeleton/SkeletonMemeTagList.tsx b/src/components/meme/MemeInfo/Skeleton/SkeletonMemeTagList.tsx
deleted file mode 100644
index cf6b567b..00000000
--- a/src/components/meme/MemeInfo/Skeleton/SkeletonMemeTagList.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Skeleton } from "@/components/common/Skeleton";
-import { SkeletonTagList } from "@/components/home/Skeleton";
-
-export const SkeletonMemeTagList = () => {
- return (
- <>
-
-
- >
- );
-};
diff --git a/src/components/meme/MemeItem/index.ts b/src/components/meme/MemeItem/index.ts
deleted file mode 100644
index 204b7d3d..00000000
--- a/src/components/meme/MemeItem/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./MemeItem";
diff --git a/src/components/meme/index.ts b/src/components/meme/index.ts
deleted file mode 100644
index fc0951d3..00000000
--- a/src/components/meme/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from "./ActionSheet";
-export * from "./InfiniteMemeList";
-export * from "./MemeInfo";
-export * from "./MemeItem";
diff --git a/src/components/mypage/index.ts b/src/components/mypage/index.ts
deleted file mode 100644
index 2e435930..00000000
--- a/src/components/mypage/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./SummarizedCollection";
diff --git a/src/components/search/SearchRecent/index.ts b/src/components/search/SearchRecent/index.ts
deleted file mode 100644
index ec027fa2..00000000
--- a/src/components/search/SearchRecent/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./SearchRecent";
diff --git a/src/components/search/SearchResult/index.ts b/src/components/search/SearchResult/index.ts
deleted file mode 100644
index 40ae39a1..00000000
--- a/src/components/search/SearchResult/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./SearchResultList";
diff --git a/src/components/search/index.ts b/src/components/search/index.ts
deleted file mode 100644
index 53bccf20..00000000
--- a/src/components/search/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export * from "./SearchInput";
-export * from "./SearchItem";
-export * from "./SearchPopular";
-export * from "./SearchRecent";
-export * from "./SearchResult";
diff --git a/src/components/tags/TagCategory/Category.stories.tsx b/src/components/tags/TagCategory/Category.stories.tsx
deleted file mode 100644
index 211c6359..00000000
--- a/src/components/tags/TagCategory/Category.stories.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import type { ComponentMeta, ComponentStory } from "@storybook/react";
-
-import { CategoryContent } from "./CategoryContent";
-
-export default {
- title: "components/common/Category",
- component: CategoryContent,
-} as ComponentMeta;
-
-export const Default: ComponentStory = () => ;
diff --git a/src/components/tags/TagFavoriteButton/index.ts b/src/components/tags/TagFavoriteButton/index.ts
deleted file mode 100644
index 3858de9d..00000000
--- a/src/components/tags/TagFavoriteButton/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./TagBookmarkButton";
diff --git a/src/components/tags/index.ts b/src/components/tags/index.ts
deleted file mode 100644
index 9bcc64e3..00000000
--- a/src/components/tags/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./TagCategory";
-export * from "./TagFavoriteButton";
diff --git a/src/components/collect/Collection/Collection.tsx b/src/features/collect/components/Collection.tsx
similarity index 89%
rename from src/components/collect/Collection/Collection.tsx
rename to src/features/collect/components/Collection.tsx
index 14b45a52..51005fff 100644
--- a/src/components/collect/Collection/Collection.tsx
+++ b/src/features/collect/components/Collection.tsx
@@ -1,5 +1,5 @@
-import { useGetMemesByCollectionId } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
+import { useGetMemesByCollectionId } from "@/api/meme";
+import { InfiniteMemeList } from "@/features/common";
interface Props {
collectionId: number;
diff --git a/src/components/collect/SearchedCollection/SearchedCollection.tsx b/src/features/collect/components/SearchedCollection.tsx
similarity index 90%
rename from src/components/collect/SearchedCollection/SearchedCollection.tsx
rename to src/features/collect/components/SearchedCollection.tsx
index 6b36b5f8..f779c8ce 100644
--- a/src/components/collect/SearchedCollection/SearchedCollection.tsx
+++ b/src/features/collect/components/SearchedCollection.tsx
@@ -1,5 +1,5 @@
-import { useGetMemesFromCollectionByKeyword } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
+import { useGetMemesFromCollectionByKeyword } from "@/api/search";
+import { InfiniteMemeList } from "@/features/common";
interface Props {
searchQuery: string;
diff --git a/src/components/collect/index.ts b/src/features/collect/components/index.ts
similarity index 100%
rename from src/components/collect/index.ts
rename to src/features/collect/components/index.ts
diff --git a/src/components/explore/EmptyMemesView/EmptyMemesView.tsx b/src/features/common/components/EmptyMemesView.tsx
similarity index 84%
rename from src/components/explore/EmptyMemesView/EmptyMemesView.tsx
rename to src/features/common/components/EmptyMemesView.tsx
index 0173ea25..c7b449e6 100644
--- a/src/components/explore/EmptyMemesView/EmptyMemesView.tsx
+++ b/src/features/common/components/EmptyMemesView.tsx
@@ -1,6 +1,6 @@
-import { channelUrl } from "@/application/util";
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
+import { Button } from "@/common/components/Button";
+import { Icon } from "@/common/components/Icon";
+import { channelUrl } from "@/common/utils";
export const EmptyMemesView = () => {
return (
diff --git a/src/components/meme/InfiniteMemeList/InfiniteMemeList.tsx b/src/features/common/components/InfiniteMemeList.tsx
similarity index 78%
rename from src/components/meme/InfiniteMemeList/InfiniteMemeList.tsx
rename to src/features/common/components/InfiniteMemeList.tsx
index 73aebde4..a1af5d76 100644
--- a/src/components/meme/InfiniteMemeList/InfiniteMemeList.tsx
+++ b/src/features/common/components/InfiniteMemeList.tsx
@@ -2,12 +2,13 @@ import type { UseInfiniteQueryResult } from "@tanstack/react-query";
import { useQueryClient } from "@tanstack/react-query";
import { useCallback, useMemo } from "react";
-import { prefetchCollectionCheck, useIntersect } from "@/application/hooks";
-import { CORE_QUERY_KEY } from "@/application/hooks/api/core/queryKey";
-import { QUERY_KEYS } from "@/application/hooks/api/meme/queryKey";
-import { Masonry } from "@/components/common/Masonry";
-import { renderMemeItemSkeletons } from "@/components/common/Skeleton";
-import { MemeItem } from "@/components/meme/MemeItem";
+import { useGetCollectionCheck } from "@/api/collection";
+import { CORE_QUERY_KEY } from "@/api/core";
+import { useGetMemeDetailById } from "@/api/meme";
+import { Masonry } from "@/common/components/Masonry";
+import { renderMemeItemSkeletons } from "@/common/components/Skeleton";
+import { useIntersect } from "@/common/hooks";
+import { MemeItem } from "@/features/common";
import type { GetMemesResponse, Meme } from "@/types";
const skeletons = renderMemeItemSkeletons(4);
@@ -53,15 +54,15 @@ export const InfiniteMemeList = ({
if (cachedMeme) {
queryClient.setQueryData(
- QUERY_KEYS.getMemeDetailById(String(cachedMeme.memeId)),
+ useGetMemeDetailById.queryKey(String(cachedMeme.memeId)),
cachedMeme,
);
// NOTE: 조회수 증가를 위해 한번 더 밈 상세 api를 fetch 합니다
- queryClient.invalidateQueries(QUERY_KEYS.getMemeDetailById(String(cachedMeme.memeId)));
+ queryClient.invalidateQueries(useGetMemeDetailById.queryKey(String(cachedMeme.memeId)));
// NOTE: collection check api에 waterfall 현상이 일어나기 때문에 prefetch 합니다
- prefetchCollectionCheck(cachedMeme.memeId, queryClient);
+ useGetCollectionCheck.prefetchQuery(cachedMeme.memeId, queryClient);
}
},
[queryClient],
diff --git a/src/components/meme/ActionSheet/MemeActionSheet.tsx b/src/features/common/components/MemeActionSheet.tsx
similarity index 85%
rename from src/components/meme/ActionSheet/MemeActionSheet.tsx
rename to src/features/common/components/MemeActionSheet.tsx
index 78155db3..c1080935 100644
--- a/src/components/meme/ActionSheet/MemeActionSheet.tsx
+++ b/src/features/common/components/MemeActionSheet.tsx
@@ -1,12 +1,14 @@
import { Suspense } from "react";
import tw from "twin.macro";
-import { useAuth, useCollection, useOverlay } from "@/application/hooks";
-import { channelUrl } from "@/application/util";
-import { ActionSheet } from "@/components/common/ActionSheet";
+import { ActionSheet } from "@/common/components/ActionSheet";
+import { useOverlay } from "@/common/hooks";
+import { channelUrl } from "@/common/utils";
+import { useAuth } from "@/features/common";
+import { MemeShareModal } from "@/features/memes/components";
import type { Meme } from "@/types";
-import { MemeShareModal } from "../MemeInfo/Modal";
+import { useCollection } from "../hooks";
interface Props {
meme: Meme;
diff --git a/src/components/meme/MemeItem/MemeItem.tsx b/src/features/common/components/MemeItem.tsx
similarity index 85%
rename from src/components/meme/MemeItem/MemeItem.tsx
rename to src/features/common/components/MemeItem.tsx
index 5aa67b5e..f06ffc3f 100644
--- a/src/components/meme/MemeItem/MemeItem.tsx
+++ b/src/features/common/components/MemeItem.tsx
@@ -1,13 +1,12 @@
import { memo } from "react";
-import { useMoveMemeDetail, useOverlay } from "@/application/hooks";
-import { isEncodingError } from "@/application/util";
-import { Icon } from "@/components/common/Icon";
-import { Photo } from "@/components/common/Photo";
+import { Icon } from "@/common/components/Icon";
+import { Photo } from "@/common/components/Photo";
+import { useOverlay } from "@/common/hooks";
+import { isEncodingError } from "@/common/utils";
+import { MemeActionSheet, useMoveMemeDetail } from "@/features/common";
import type { Meme } from "@/types";
-import { MemeActionSheet } from "../ActionSheet";
-
interface Props {
meme: Meme;
onClick?: (id: number) => void;
diff --git a/src/components/tags/TagCategory/CategoryContent.tsx b/src/features/common/components/TagCategory/CategoryContent.tsx
similarity index 95%
rename from src/components/tags/TagCategory/CategoryContent.tsx
rename to src/features/common/components/TagCategory/CategoryContent.tsx
index 34b3a059..b35b1215 100644
--- a/src/components/tags/TagCategory/CategoryContent.tsx
+++ b/src/features/common/components/TagCategory/CategoryContent.tsx
@@ -2,10 +2,10 @@ import { Content, Header, Item, Root, Trigger } from "@radix-ui/react-accordion"
import { useRouter } from "next/router";
import React, { Fragment } from "react";
-import { useGetCategoryWithTag } from "@/application/hooks";
-import { PATH } from "@/application/util";
-import { Icon } from "@/components/common/Icon";
-import { Photo } from "@/components/common/Photo";
+import { useGetCategoryWithTag } from "@/api/tag";
+import { Icon } from "@/common/components/Icon";
+import { Photo } from "@/common/components/Photo";
+import { PATH } from "@/common/utils";
import { CategoryTitle } from "./CategoryTitle";
import { useTagCategoryContext } from "./context";
diff --git a/src/components/tags/TagCategory/CategoryTitle.tsx b/src/features/common/components/TagCategory/CategoryTitle.tsx
similarity index 100%
rename from src/components/tags/TagCategory/CategoryTitle.tsx
rename to src/features/common/components/TagCategory/CategoryTitle.tsx
diff --git a/src/components/tags/TagCategory/FavoriteCategory.tsx b/src/features/common/components/TagCategory/FavoriteCategory.tsx
similarity index 92%
rename from src/components/tags/TagCategory/FavoriteCategory.tsx
rename to src/features/common/components/TagCategory/FavoriteCategory.tsx
index 726e342c..75321023 100644
--- a/src/components/tags/TagCategory/FavoriteCategory.tsx
+++ b/src/features/common/components/TagCategory/FavoriteCategory.tsx
@@ -1,10 +1,12 @@
import { Content, Header, Item, Trigger } from "@radix-ui/react-accordion";
import { useRouter } from "next/router";
-import { useAuth, useDeleteFavoriteTag, useGetFavoriteTags, useToast } from "@/application/hooks";
-import { PATH } from "@/application/util";
-import { Icon } from "@/components/common/Icon";
-import { Photo } from "@/components/common/Photo";
+import { useDeleteFavoriteTag, useGetFavoriteTags } from "@/api/tag";
+import { Icon } from "@/common/components/Icon";
+import { Photo } from "@/common/components/Photo";
+import { useToast } from "@/common/hooks";
+import { PATH } from "@/common/utils";
+import { useAuth } from "@/features/common";
import { CategoryTitle } from "./CategoryTitle";
import { useTagCategoryContext } from "./context";
diff --git a/src/components/tags/TagCategory/SlotCategory.tsx b/src/features/common/components/TagCategory/SlotCategory.tsx
similarity index 100%
rename from src/components/tags/TagCategory/SlotCategory.tsx
rename to src/features/common/components/TagCategory/SlotCategory.tsx
diff --git a/src/components/tags/TagCategory/TagCategory.tsx b/src/features/common/components/TagCategory/TagCategory.tsx
similarity index 88%
rename from src/components/tags/TagCategory/TagCategory.tsx
rename to src/features/common/components/TagCategory/TagCategory.tsx
index 690d7c04..678a3d4b 100644
--- a/src/components/tags/TagCategory/TagCategory.tsx
+++ b/src/features/common/components/TagCategory/TagCategory.tsx
@@ -1,8 +1,8 @@
import { css } from "twin.macro";
-import { Drawer } from "@/components/common/Drawer";
-import { Icon } from "@/components/common/Icon";
-import { SSRSuspense } from "@/components/common/Suspense";
+import { Drawer } from "@/common/components/Drawer";
+import { Icon } from "@/common/components/Icon";
+import { SSRSuspense } from "@/common/components/Suspense";
import { CategoryContent } from "./CategoryContent";
import { useTagCategoryContext } from "./context";
diff --git a/src/components/tags/TagCategory/context.tsx b/src/features/common/components/TagCategory/context.tsx
similarity index 100%
rename from src/components/tags/TagCategory/context.tsx
rename to src/features/common/components/TagCategory/context.tsx
diff --git a/src/components/tags/TagCategory/index.ts b/src/features/common/components/TagCategory/index.ts
similarity index 100%
rename from src/components/tags/TagCategory/index.ts
rename to src/features/common/components/TagCategory/index.ts
diff --git a/src/features/common/components/index.ts b/src/features/common/components/index.ts
new file mode 100644
index 00000000..f58d37e7
--- /dev/null
+++ b/src/features/common/components/index.ts
@@ -0,0 +1,5 @@
+export * from "./EmptyMemesView";
+export * from "./InfiniteMemeList";
+export * from "./MemeActionSheet";
+export * from "./MemeItem";
+export * from "./TagCategory";
diff --git a/src/components/hocs/index.ts b/src/features/common/hocs/index.ts
similarity index 100%
rename from src/components/hocs/index.ts
rename to src/features/common/hocs/index.ts
diff --git a/src/components/hocs/withAuth/index.ts b/src/features/common/hocs/withAuth/index.ts
similarity index 100%
rename from src/components/hocs/withAuth/index.ts
rename to src/features/common/hocs/withAuth/index.ts
diff --git a/src/components/hocs/withAuth/withAuth.tsx b/src/features/common/hocs/withAuth/withAuth.tsx
similarity index 90%
rename from src/components/hocs/withAuth/withAuth.tsx
rename to src/features/common/hocs/withAuth/withAuth.tsx
index 5573b614..48e665b8 100644
--- a/src/components/hocs/withAuth/withAuth.tsx
+++ b/src/features/common/hocs/withAuth/withAuth.tsx
@@ -2,7 +2,8 @@ import { useRouter } from "next/router";
import type { ComponentType } from "react";
import { useEffect } from "react";
-import { useAuth, useToast } from "@/application/hooks";
+import { useToast } from "@/common/hooks";
+import { useAuth } from "@/features/common";
export const withAuth = (WrappedComponent: ComponentType) => {
const displayName = WrappedComponent.displayName || WrappedComponent.name || "Component";
diff --git a/src/features/common/hooks/index.ts b/src/features/common/hooks/index.ts
new file mode 100644
index 00000000..3431fa9c
--- /dev/null
+++ b/src/features/common/hooks/index.ts
@@ -0,0 +1,4 @@
+export * from "./useAuth";
+export * from "./useChannelIO";
+export * from "./useCollection";
+export * from "./useMoveMemeDetail";
diff --git a/src/application/hooks/domain/auth/useAuth.ts b/src/features/common/hooks/useAuth.ts
similarity index 84%
rename from src/application/hooks/domain/auth/useAuth.ts
rename to src/features/common/hooks/useAuth.ts
index 73ad1fa2..4ca5c862 100644
--- a/src/application/hooks/domain/auth/useAuth.ts
+++ b/src/features/common/hooks/useAuth.ts
@@ -1,8 +1,8 @@
import { useCallback } from "react";
-import { useGetMyAccount, useLogout } from "@/application/hooks";
-import { useSignUpModalContext } from "@/components/common/Modal";
-import { api } from "@/infra/api";
+import { useGetMyAccount, useLogout } from "@/api/account";
+import { api } from "@/api/core";
+import { useSignUpModalContext } from "@/common/components/Modal";
type Handler = (...args: any[]) => unknown;
interface ValidatorOptions {
diff --git a/src/application/hooks/domain/channel/useChannelIO.ts b/src/features/common/hooks/useChannelIO.ts
similarity index 94%
rename from src/application/hooks/domain/channel/useChannelIO.ts
rename to src/features/common/hooks/useChannelIO.ts
index 642f37e8..31de5210 100644
--- a/src/application/hooks/domain/channel/useChannelIO.ts
+++ b/src/features/common/hooks/useChannelIO.ts
@@ -1,6 +1,6 @@
import { useEffect } from "react";
-import { ChannelService } from "@/infra/sdk";
+import { ChannelService } from "@/common/libs";
import type { User } from "@/types";
interface Props {
diff --git a/src/application/hooks/domain/collection/useCollection.tsx b/src/features/common/hooks/useCollection.tsx
similarity index 96%
rename from src/application/hooks/domain/collection/useCollection.tsx
rename to src/features/common/hooks/useCollection.tsx
index 1e7e08fa..5ae60c50 100644
--- a/src/application/hooks/domain/collection/useCollection.tsx
+++ b/src/features/common/hooks/useCollection.tsx
@@ -4,8 +4,8 @@ import {
useDeleteMemeFromCollection,
useGetCollectionCheck,
usePostMemeToCollection,
- useToast,
-} from "@/application/hooks";
+} from "@/api/collection";
+import { useToast } from "@/common/hooks";
const TAG_DELETE_DELAY = 3000;
diff --git a/src/application/hooks/domain/meme/useMoveMemeDetail.ts b/src/features/common/hooks/useMoveMemeDetail.ts
similarity index 91%
rename from src/application/hooks/domain/meme/useMoveMemeDetail.ts
rename to src/features/common/hooks/useMoveMemeDetail.ts
index 2a5a8be1..d502c06a 100644
--- a/src/application/hooks/domain/meme/useMoveMemeDetail.ts
+++ b/src/features/common/hooks/useMoveMemeDetail.ts
@@ -1,6 +1,6 @@
import { useRouter } from "next/router";
-import { PATH } from "@/application/util";
+import { PATH } from "@/common/utils";
export const useMoveMemeDetail = () => {
const router = useRouter();
diff --git a/src/features/common/index.ts b/src/features/common/index.ts
new file mode 100644
index 00000000..67700710
--- /dev/null
+++ b/src/features/common/index.ts
@@ -0,0 +1,3 @@
+export * from "./components";
+export * from "./hocs";
+export * from "./hooks";
diff --git a/src/components/explore/MemesByKeyword/MemesByKeyword.tsx b/src/features/explore/keywords/components/MemesByKeyword.tsx
similarity index 73%
rename from src/components/explore/MemesByKeyword/MemesByKeyword.tsx
rename to src/features/explore/keywords/components/MemesByKeyword.tsx
index 23f1bfc1..0493af13 100644
--- a/src/components/explore/MemesByKeyword/MemesByKeyword.tsx
+++ b/src/features/explore/keywords/components/MemesByKeyword.tsx
@@ -1,7 +1,5 @@
-import { useGetMemesByKeyword } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
-
-import { EmptyMemesView } from "../EmptyMemesView";
+import { useGetMemesByKeyword } from "@/api/search";
+import { EmptyMemesView, InfiniteMemeList } from "@/features/common";
interface Props {
searchQuery: string;
diff --git a/src/components/explore/MemesByKeyword/index.tsx b/src/features/explore/keywords/components/index.ts
similarity index 100%
rename from src/components/explore/MemesByKeyword/index.tsx
rename to src/features/explore/keywords/components/index.ts
diff --git a/src/components/explore/MemesByTag/MemesByTag.tsx b/src/features/explore/tags/components/MemesByTag.tsx
similarity index 73%
rename from src/components/explore/MemesByTag/MemesByTag.tsx
rename to src/features/explore/tags/components/MemesByTag.tsx
index 29324cf9..6afe3096 100644
--- a/src/components/explore/MemesByTag/MemesByTag.tsx
+++ b/src/features/explore/tags/components/MemesByTag.tsx
@@ -1,7 +1,5 @@
-import { useGetMemesByTag } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
-
-import { EmptyMemesView } from "../EmptyMemesView";
+import { useGetMemesByTag } from "@/api/search";
+import { EmptyMemesView, InfiniteMemeList } from "@/features/common";
interface Props {
searchQuery: string;
diff --git a/src/components/tags/TagFavoriteButton/TagBookmarkButton.tsx b/src/features/explore/tags/components/TagBookmarkButton.tsx
similarity index 90%
rename from src/components/tags/TagFavoriteButton/TagBookmarkButton.tsx
rename to src/features/explore/tags/components/TagBookmarkButton.tsx
index 17e2dde2..5ef79c39 100644
--- a/src/components/tags/TagFavoriteButton/TagBookmarkButton.tsx
+++ b/src/features/explore/tags/components/TagBookmarkButton.tsx
@@ -1,14 +1,8 @@
-import {
- useAuth,
- useDeleteFavoriteTag,
- useGetTagInfo,
- usePostFavoriteTag,
- useToast,
-} from "@/application/hooks";
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
-
-import { useTagCategoryContext } from "../TagCategory";
+import { useDeleteFavoriteTag, useGetTagInfo, usePostFavoriteTag } from "@/api/tag";
+import { Button } from "@/common/components/Button";
+import { Icon } from "@/common/components/Icon";
+import { useToast } from "@/common/hooks";
+import { useAuth, useTagCategoryContext } from "@/features/common";
interface Props {
tagId: number;
diff --git a/src/components/explore/Thumbnail/Thumbnail.tsx b/src/features/explore/tags/components/Thumbnail.tsx
similarity index 86%
rename from src/components/explore/Thumbnail/Thumbnail.tsx
rename to src/features/explore/tags/components/Thumbnail.tsx
index 406479d3..70adce29 100644
--- a/src/components/explore/Thumbnail/Thumbnail.tsx
+++ b/src/features/explore/tags/components/Thumbnail.tsx
@@ -1,8 +1,9 @@
import { useRouter } from "next/router";
-import { useClipboard, useGetMemesByTag, useToast } from "@/application/hooks";
-import { DOMAIN } from "@/application/util";
-import { Photo } from "@/components/common/Photo";
+import { useGetMemesByTag } from "@/api/search";
+import { Photo } from "@/common/components/Photo";
+import { useClipboard, useToast } from "@/common/hooks";
+import { DOMAIN } from "@/common/utils";
interface Props {
tag: string;
diff --git a/src/features/explore/tags/components/index.ts b/src/features/explore/tags/components/index.ts
new file mode 100644
index 00000000..a1e08c4e
--- /dev/null
+++ b/src/features/explore/tags/components/index.ts
@@ -0,0 +1,3 @@
+export * from "./MemesByTag";
+export * from "./TagBookmarkButton";
+export * from "./Thumbnail";
diff --git a/src/components/home/MemeListContainer/MemeList/CommonMemeList.tsx b/src/features/home/components/MemeListContainer/CommonMemeList.tsx
similarity index 70%
rename from src/components/home/MemeListContainer/MemeList/CommonMemeList.tsx
rename to src/features/home/components/MemeListContainer/CommonMemeList.tsx
index 46bcaca1..25a07b46 100644
--- a/src/components/home/MemeListContainer/MemeList/CommonMemeList.tsx
+++ b/src/features/home/components/MemeListContainer/CommonMemeList.tsx
@@ -1,7 +1,7 @@
-import { useGetMemesBySort } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
+import { useGetMemesBySort } from "@/api/meme";
+import { InfiniteMemeList } from "@/features/common";
-import type { MemeListType } from "../type";
+import type { MemeListType } from "./type";
interface Props {
sortBy: MemeListType;
diff --git a/src/components/home/MemeListContainer/MemeListContainer.tsx b/src/features/home/components/MemeListContainer/MemeListContainer.tsx
similarity index 63%
rename from src/components/home/MemeListContainer/MemeListContainer.tsx
rename to src/features/home/components/MemeListContainer/MemeListContainer.tsx
index 609d7cc4..8cca537c 100644
--- a/src/components/home/MemeListContainer/MemeListContainer.tsx
+++ b/src/features/home/components/MemeListContainer/MemeListContainer.tsx
@@ -1,10 +1,10 @@
import { useState } from "react";
-import { MemeListSkeleton } from "@/components/common/Skeleton";
-import { SSRSuspense } from "@/components/common/Suspense";
+import { MemeListSkeleton } from "@/common/components/Skeleton";
+import { SSRSuspense } from "@/common/components/Suspense";
-import { MemeSortDropDown } from "./DropDown";
-import { CommonMemeList } from "./MemeList";
+import { CommonMemeList } from "./CommonMemeList";
+import { MemeSortDropDown } from "./MemeSortDropDown";
import type { MemeListType } from "./type";
export const MemeListContainer = () => {
diff --git a/src/components/home/MemeListContainer/DropDown/MemeSortDropDown.tsx b/src/features/home/components/MemeListContainer/MemeSortDropDown.tsx
similarity index 94%
rename from src/components/home/MemeListContainer/DropDown/MemeSortDropDown.tsx
rename to src/features/home/components/MemeListContainer/MemeSortDropDown.tsx
index bb8da01b..7b39d40d 100644
--- a/src/components/home/MemeListContainer/DropDown/MemeSortDropDown.tsx
+++ b/src/features/home/components/MemeListContainer/MemeSortDropDown.tsx
@@ -2,10 +2,10 @@ import type { Dispatch, SetStateAction } from "react";
import { startTransition, useCallback } from "react";
import { css } from "twin.macro";
-import { DropDown } from "@/components/common/DropDown";
-import { Icon } from "@/components/common/Icon";
+import { DropDown } from "@/common/components/DropDown";
+import { Icon } from "@/common/components/Icon";
-import type { MemeListType } from "../type";
+import type { MemeListType } from "./type";
interface Props {
sortBy: MemeListType;
diff --git a/src/components/home/MemeListContainer/index.ts b/src/features/home/components/MemeListContainer/index.ts
similarity index 100%
rename from src/components/home/MemeListContainer/index.ts
rename to src/features/home/components/MemeListContainer/index.ts
diff --git a/src/components/home/MemeListContainer/type.ts b/src/features/home/components/MemeListContainer/type.ts
similarity index 100%
rename from src/components/home/MemeListContainer/type.ts
rename to src/features/home/components/MemeListContainer/type.ts
diff --git a/src/components/home/index.ts b/src/features/home/components/index.ts
similarity index 52%
rename from src/components/home/index.ts
rename to src/features/home/components/index.ts
index 36a1e823..460b4644 100644
--- a/src/components/home/index.ts
+++ b/src/features/home/components/index.ts
@@ -1,2 +1 @@
export * from "./MemeListContainer";
-export * from "./UserSharedMeme";
diff --git a/src/features/memes/components/MemeCTAList.tsx b/src/features/memes/components/MemeCTAList.tsx
new file mode 100644
index 00000000..dc92c863
--- /dev/null
+++ b/src/features/memes/components/MemeCTAList.tsx
@@ -0,0 +1,62 @@
+import { Suspense } from "react";
+
+import { Button } from "@/common/components/Button";
+import { Icon } from "@/common/components/Icon";
+import { useOverlay } from "@/common/hooks";
+import { useAuth, useCollection } from "@/features/common";
+
+import { MemeShareModal } from "./MemeShareModal";
+
+interface MemeCTAListProps {
+ id: string;
+}
+
+export const MemeCTAList = ({ id }: MemeCTAListProps) => {
+ const overlay = useOverlay();
+
+ return (
+
+
+
+
+
+ );
+};
+
+interface CollectionSaveButtonProps {
+ id: string;
+}
+const CollectionSaveButton = ({ id }: CollectionSaveButtonProps) => {
+ const { validate, isLogin } = useAuth();
+ const { isAdded, onUpdateCollection } = useCollection({ memeId: Number(id), isLogin });
+
+ return (
+
+ );
+};
diff --git a/src/components/meme/MemeInfo/MemeDetail.stories.tsx b/src/features/memes/components/MemeDetail/MemeDetail.stories.tsx
similarity index 83%
rename from src/components/meme/MemeInfo/MemeDetail.stories.tsx
rename to src/features/memes/components/MemeDetail/MemeDetail.stories.tsx
index 82c2dd44..ef3f62db 100644
--- a/src/components/meme/MemeInfo/MemeDetail.stories.tsx
+++ b/src/features/memes/components/MemeDetail/MemeDetail.stories.tsx
@@ -1,6 +1,6 @@
import type { ComponentMeta, ComponentStory } from "@storybook/react";
-import { MemeDetail } from "@/components/meme/MemeInfo";
+import { MemeDetail } from "./MemeDetail";
export default {
title: "components/meme/MemeDetail",
diff --git a/src/components/meme/MemeInfo/MemeDetail.tsx b/src/features/memes/components/MemeDetail/MemeDetail.tsx
similarity index 84%
rename from src/components/meme/MemeInfo/MemeDetail.tsx
rename to src/features/memes/components/MemeDetail/MemeDetail.tsx
index a75cb715..74978b5a 100644
--- a/src/components/meme/MemeInfo/MemeDetail.tsx
+++ b/src/features/memes/components/MemeDetail/MemeDetail.tsx
@@ -1,9 +1,10 @@
import { css } from "twin.macro";
-import { useMemeDetailById } from "@/application/hooks";
-import { Photo } from "@/components/common/Photo";
-import { SSRSuspense } from "@/components/common/Suspense";
-import { MemeExport } from "@/components/meme/MemeInfo/DropDown/MemeExport";
+import { useGetMemeDetailById } from "@/api/meme";
+import { Photo } from "@/common/components/Photo";
+import { SSRSuspense } from "@/common/components/Suspense";
+
+import { MemeExport } from "./MemeExport";
interface Props {
id: string;
@@ -18,7 +19,7 @@ export const MemeDetail = ({ id }: Props) => {
description,
image: { images },
isRefetching,
- } = useMemeDetailById(id);
+ } = useGetMemeDetailById(id);
const { imageUrl, imageWidth, imageHeight } = images[0];
diff --git a/src/components/meme/MemeInfo/DropDown/MemeExport.tsx b/src/features/memes/components/MemeDetail/MemeExport.tsx
similarity index 82%
rename from src/components/meme/MemeInfo/DropDown/MemeExport.tsx
rename to src/features/memes/components/MemeDetail/MemeExport.tsx
index ad365aed..5597d360 100644
--- a/src/components/meme/MemeInfo/DropDown/MemeExport.tsx
+++ b/src/features/memes/components/MemeDetail/MemeExport.tsx
@@ -1,22 +1,19 @@
import tw from "twin.macro";
-import {
- useAuth,
- useCollection,
- useMemeDetailById,
- usePostMemeToSharedCollection,
- useToast,
-} from "@/application/hooks";
-import { DOMAIN, PATH } from "@/application/util";
-import { DropDown } from "@/components/common/DropDown";
-import { Icon } from "@/components/common/Icon";
+import { usePostMemeToSharedCollection } from "@/api/collection";
+import { useGetMemeDetailById } from "@/api/meme";
+import { DropDown } from "@/common/components/DropDown";
+import { Icon } from "@/common/components/Icon";
+import { useToast } from "@/common/hooks";
+import { DOMAIN, PATH } from "@/common/utils";
+import { useAuth, useCollection } from "@/features/common";
interface Props {
id: string;
}
export const MemeExport = ({ id }: Props) => {
- const { name, description } = useMemeDetailById(id);
+ const { name, description } = useGetMemeDetailById(id);
const { validate, isLogin, user } = useAuth();
const { onUpdateCollection } = useCollection({ memeId: Number(id), isLogin });
diff --git a/src/features/memes/components/MemeDetail/index.ts b/src/features/memes/components/MemeDetail/index.ts
new file mode 100644
index 00000000..7bfbabb2
--- /dev/null
+++ b/src/features/memes/components/MemeDetail/index.ts
@@ -0,0 +1 @@
+export * from "./MemeDetail";
diff --git a/src/components/meme/MemeInfo/Button/ClipboardCopyButton.tsx b/src/features/memes/components/MemeShareModal/ClipboardCopyButton.tsx
similarity index 75%
rename from src/components/meme/MemeInfo/Button/ClipboardCopyButton.tsx
rename to src/features/memes/components/MemeShareModal/ClipboardCopyButton.tsx
index d07e32df..315e7bda 100644
--- a/src/components/meme/MemeInfo/Button/ClipboardCopyButton.tsx
+++ b/src/features/memes/components/MemeShareModal/ClipboardCopyButton.tsx
@@ -1,6 +1,6 @@
-import { useClipboard } from "@/application/hooks";
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
+import { Button } from "@/common/components/Button";
+import { Icon } from "@/common/components/Icon";
+import { useClipboard } from "@/common/hooks";
interface Props {
target: string;
diff --git a/src/components/meme/MemeInfo/Button/KakaoShareButton.tsx b/src/features/memes/components/MemeShareModal/KakaoShareButton.tsx
similarity index 68%
rename from src/components/meme/MemeInfo/Button/KakaoShareButton.tsx
rename to src/features/memes/components/MemeShareModal/KakaoShareButton.tsx
index 0b07bf49..d92e444b 100644
--- a/src/components/meme/MemeInfo/Button/KakaoShareButton.tsx
+++ b/src/features/memes/components/MemeShareModal/KakaoShareButton.tsx
@@ -1,7 +1,8 @@
-import type { KakaoShareOptions } from "@/application/hooks/domain/share";
-import { useKakaoShare } from "@/application/hooks/domain/share";
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
+import { Button } from "@/common/components/Button";
+import { Icon } from "@/common/components/Icon";
+
+import type { KakaoShareOptions } from "../../hooks";
+import { useKakaoShare } from "../../hooks";
interface Props {
resource: Omit;
diff --git a/src/components/meme/MemeInfo/Modal/MemeShareModal.tsx b/src/features/memes/components/MemeShareModal/MemeShareModal.tsx
similarity index 81%
rename from src/components/meme/MemeInfo/Modal/MemeShareModal.tsx
rename to src/features/memes/components/MemeShareModal/MemeShareModal.tsx
index 32625fdd..281fcb0a 100644
--- a/src/components/meme/MemeInfo/Modal/MemeShareModal.tsx
+++ b/src/features/memes/components/MemeShareModal/MemeShareModal.tsx
@@ -1,13 +1,14 @@
-import { useAuth, useMemeDetailById, useToast } from "@/application/hooks";
-import { usePostMemeToSharedCollection } from "@/application/hooks/api/collection";
-import { DOMAIN, PATH } from "@/application/util";
-import { Modal } from "@/components/common/Modal";
-import { Photo } from "@/components/common/Photo";
-import {
- ClipboardCopyButton,
- KakaoShareButton,
- NativeShareButton,
-} from "@/components/meme/MemeInfo/Button";
+import { usePostMemeToSharedCollection } from "@/api/collection";
+import { useGetMemeDetailById } from "@/api/meme";
+import { Modal } from "@/common/components/Modal";
+import { Photo } from "@/common/components/Photo";
+import { useToast } from "@/common/hooks";
+import { DOMAIN, PATH } from "@/common/utils";
+import { useAuth } from "@/features/common";
+
+import { ClipboardCopyButton } from "./ClipboardCopyButton";
+import { KakaoShareButton } from "./KakaoShareButton";
+import { NativeShareButton } from "./NativeShareButton";
interface Props {
id: string;
@@ -23,7 +24,7 @@ export const MemeShareModal = ({ id, isOpen, onClose }: Props) => {
name,
description,
image: { images },
- } = useMemeDetailById(id);
+ } = useGetMemeDetailById(id);
const src = images[0].imageUrl;
diff --git a/src/components/meme/MemeInfo/Button/NativeShareButton.tsx b/src/features/memes/components/MemeShareModal/NativeShareButton.tsx
similarity index 89%
rename from src/components/meme/MemeInfo/Button/NativeShareButton.tsx
rename to src/features/memes/components/MemeShareModal/NativeShareButton.tsx
index 76917b03..5bf0e335 100644
--- a/src/components/meme/MemeInfo/Button/NativeShareButton.tsx
+++ b/src/features/memes/components/MemeShareModal/NativeShareButton.tsx
@@ -1,5 +1,5 @@
-import { Button } from "@/components/common/Button";
-import { Icon } from "@/components/common/Icon";
+import { Button } from "@/common/components/Button";
+import { Icon } from "@/common/components/Icon";
interface Props {
title: string;
diff --git a/src/components/meme/MemeInfo/Modal/index.ts b/src/features/memes/components/MemeShareModal/index.ts
similarity index 100%
rename from src/components/meme/MemeInfo/Modal/index.ts
rename to src/features/memes/components/MemeShareModal/index.ts
diff --git a/src/components/meme/MemeInfo/MemeTagList.tsx b/src/features/memes/components/MemeTagList.tsx
similarity index 88%
rename from src/components/meme/MemeInfo/MemeTagList.tsx
rename to src/features/memes/components/MemeTagList.tsx
index 0b425ac2..3794e0be 100644
--- a/src/components/meme/MemeInfo/MemeTagList.tsx
+++ b/src/features/memes/components/MemeTagList.tsx
@@ -1,7 +1,7 @@
import Link from "next/link";
-import { useGetMemeTagsById } from "@/application/hooks";
-import { PATH } from "@/application/util";
+import { useGetMemeTagsById } from "@/api/tag";
+import { PATH } from "@/common/utils";
interface Props {
id: string;
diff --git a/src/components/meme/MemeInfo/RelativeMemeList.tsx b/src/features/memes/components/RelativeMemeList.tsx
similarity index 80%
rename from src/components/meme/MemeInfo/RelativeMemeList.tsx
rename to src/features/memes/components/RelativeMemeList.tsx
index 4de95573..cecc1950 100644
--- a/src/components/meme/MemeInfo/RelativeMemeList.tsx
+++ b/src/features/memes/components/RelativeMemeList.tsx
@@ -1,5 +1,5 @@
-import { useAuth, useGetMemesBySort } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
+import { useGetMemesBySort } from "@/api/meme";
+import { InfiniteMemeList, useAuth } from "@/features/common";
export const RelativeMemeList = () => {
const { data: memeList, isFetchingNextPage, fetchNextPage } = useGetMemesBySort("popular");
diff --git a/src/components/meme/MemeInfo/Skeleton/SkeletonMemeDetail.tsx b/src/features/memes/components/Skeleton/SkeletonMemeDetail.tsx
similarity index 87%
rename from src/components/meme/MemeInfo/Skeleton/SkeletonMemeDetail.tsx
rename to src/features/memes/components/Skeleton/SkeletonMemeDetail.tsx
index 1e20912c..dc156608 100644
--- a/src/components/meme/MemeInfo/Skeleton/SkeletonMemeDetail.tsx
+++ b/src/features/memes/components/Skeleton/SkeletonMemeDetail.tsx
@@ -1,5 +1,6 @@
-import { Skeleton } from "@/components/common/Skeleton";
-import { SkeletonMemeTagList } from "@/components/meme";
+import { Skeleton } from "@/common/components/Skeleton";
+
+import { SkeletonMemeTagList } from "./SkeletonMemeTagList";
export const SkeletonMemeDetail = () => {
return (
diff --git a/src/features/memes/components/Skeleton/SkeletonMemeTagList.tsx b/src/features/memes/components/Skeleton/SkeletonMemeTagList.tsx
new file mode 100644
index 00000000..4122f556
--- /dev/null
+++ b/src/features/memes/components/Skeleton/SkeletonMemeTagList.tsx
@@ -0,0 +1,27 @@
+import { Skeleton } from "@/common/components/Skeleton";
+
+export const SkeletonMemeTagList = () => {
+ return (
+ <>
+
+
+ {Array.from(Array(3).keys()).map((i) => (
+
+ ))}
+
+ >
+ );
+};
diff --git a/src/components/meme/MemeInfo/Skeleton/index.ts b/src/features/memes/components/Skeleton/index.ts
similarity index 100%
rename from src/components/meme/MemeInfo/Skeleton/index.ts
rename to src/features/memes/components/Skeleton/index.ts
diff --git a/src/components/meme/MemeInfo/index.ts b/src/features/memes/components/index.ts
similarity index 82%
rename from src/components/meme/MemeInfo/index.ts
rename to src/features/memes/components/index.ts
index 14c0cb61..d4cfabdf 100644
--- a/src/components/meme/MemeInfo/index.ts
+++ b/src/features/memes/components/index.ts
@@ -1,5 +1,6 @@
export * from "./MemeCTAList";
export * from "./MemeDetail";
+export * from "./MemeShareModal";
export * from "./MemeTagList";
export * from "./RelativeMemeList";
export * from "./Skeleton";
diff --git a/src/application/hooks/domain/share/index.ts b/src/features/memes/hooks/index.ts
similarity index 100%
rename from src/application/hooks/domain/share/index.ts
rename to src/features/memes/hooks/index.ts
diff --git a/src/application/hooks/domain/share/useKakaoShare.ts b/src/features/memes/hooks/useKakaoShare.ts
similarity index 97%
rename from src/application/hooks/domain/share/useKakaoShare.ts
rename to src/features/memes/hooks/useKakaoShare.ts
index cedd4272..cbb1a676 100644
--- a/src/application/hooks/domain/share/useKakaoShare.ts
+++ b/src/features/memes/hooks/useKakaoShare.ts
@@ -1,6 +1,6 @@
import { useCallback } from "react";
-import { KakaoSDK } from "@/infra/sdk";
+import { KakaoSDK } from "@/common/libs";
export interface KakaoShareOptions {
title: string;
diff --git a/src/components/mypage/SummarizedCollection/SummarizedCollection.tsx b/src/features/mypage/components/SummarizedCollection.tsx
similarity index 89%
rename from src/components/mypage/SummarizedCollection/SummarizedCollection.tsx
rename to src/features/mypage/components/SummarizedCollection.tsx
index 2689e8de..c99843b5 100644
--- a/src/components/mypage/SummarizedCollection/SummarizedCollection.tsx
+++ b/src/features/mypage/components/SummarizedCollection.tsx
@@ -1,6 +1,6 @@
-import { useGetMemesByCollectionId } from "@/application/hooks";
-import { Masonry } from "@/components/common/Masonry";
-import { MemeItem } from "@/components/meme/MemeItem";
+import { useGetMemesByCollectionId } from "@/api/meme";
+import { Masonry } from "@/common/components/Masonry";
+import { MemeItem } from "@/features/common";
interface Props {
collectionId: number;
diff --git a/src/components/mypage/SummarizedCollection/index.ts b/src/features/mypage/components/index.ts
similarity index 100%
rename from src/components/mypage/SummarizedCollection/index.ts
rename to src/features/mypage/components/index.ts
diff --git a/src/components/search/SearchInput/SearchInput.stories.tsx b/src/features/search/components/SearchInput/SearchInput.stories.tsx
similarity index 100%
rename from src/components/search/SearchInput/SearchInput.stories.tsx
rename to src/features/search/components/SearchInput/SearchInput.stories.tsx
diff --git a/src/components/search/SearchInput/SearchInput.tsx b/src/features/search/components/SearchInput/SearchInput.tsx
similarity index 92%
rename from src/components/search/SearchInput/SearchInput.tsx
rename to src/features/search/components/SearchInput/SearchInput.tsx
index 7813023d..cde405b2 100644
--- a/src/components/search/SearchInput/SearchInput.tsx
+++ b/src/features/search/components/SearchInput/SearchInput.tsx
@@ -1,7 +1,7 @@
import type { InputHTMLAttributes } from "react";
-import { Icon } from "@/components/common/Icon";
-import { InputBase } from "@/components/common/Input";
+import { Icon } from "@/common/components/Icon";
+import { InputBase } from "@/common/components/Input";
interface Props extends InputHTMLAttributes {
onReset?: () => void;
diff --git a/src/components/search/SearchInput/index.ts b/src/features/search/components/SearchInput/index.ts
similarity index 100%
rename from src/components/search/SearchInput/index.ts
rename to src/features/search/components/SearchInput/index.ts
diff --git a/src/components/search/SearchItem/SearchItem.tsx b/src/features/search/components/SearchItem/SearchItem.tsx
similarity index 93%
rename from src/components/search/SearchItem/SearchItem.tsx
rename to src/features/search/components/SearchItem/SearchItem.tsx
index 62290abe..fc1c3911 100644
--- a/src/components/search/SearchItem/SearchItem.tsx
+++ b/src/features/search/components/SearchItem/SearchItem.tsx
@@ -1,6 +1,6 @@
import type { HTMLAttributes, ReactNode } from "react";
-import { useColoredText } from "@/application/hooks";
+import { useColoredText } from "@/common/hooks";
interface SearchItemProps extends HTMLAttributes {
searchText?: string;
diff --git a/src/components/search/SearchItem/index.ts b/src/features/search/components/SearchItem/index.ts
similarity index 100%
rename from src/components/search/SearchItem/index.ts
rename to src/features/search/components/SearchItem/index.ts
diff --git a/src/components/search/SearchItem/searchItem.stories.tsx b/src/features/search/components/SearchItem/searchItem.stories.tsx
similarity index 91%
rename from src/components/search/SearchItem/searchItem.stories.tsx
rename to src/features/search/components/SearchItem/searchItem.stories.tsx
index 28083090..5011c92c 100644
--- a/src/components/search/SearchItem/searchItem.stories.tsx
+++ b/src/features/search/components/SearchItem/searchItem.stories.tsx
@@ -1,6 +1,6 @@
import type { ComponentMeta } from "@storybook/react";
-import { Chip } from "@/components/common/Chip";
+import { Chip } from "@/common/components/Chip";
import { SearchItem } from "./SearchItem";
diff --git a/src/components/search/SearchPopular/SearchPopularItem.tsx b/src/features/search/components/SearchPopularList/SearchPopularItem.tsx
similarity index 93%
rename from src/components/search/SearchPopular/SearchPopularItem.tsx
rename to src/features/search/components/SearchPopularList/SearchPopularItem.tsx
index 8a65ad0f..3fe7808f 100644
--- a/src/components/search/SearchPopular/SearchPopularItem.tsx
+++ b/src/features/search/components/SearchPopularList/SearchPopularItem.tsx
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from "react";
-import { Photo } from "@/components/common/Photo";
+import { Photo } from "@/common/components/Photo";
interface Props extends HTMLAttributes {
name: string;
diff --git a/src/components/search/SearchPopular/SearchPopularList.tsx b/src/features/search/components/SearchPopularList/SearchPopularList.tsx
similarity index 84%
rename from src/components/search/SearchPopular/SearchPopularList.tsx
rename to src/features/search/components/SearchPopularList/SearchPopularList.tsx
index bf07867c..8922a4f6 100644
--- a/src/components/search/SearchPopular/SearchPopularList.tsx
+++ b/src/features/search/components/SearchPopularList/SearchPopularList.tsx
@@ -1,9 +1,9 @@
import Link from "next/link";
-import type { RecentSearch } from "@/application/hooks";
-import { useGetPopularTags } from "@/application/hooks";
-import { PATH } from "@/application/util";
+import { useGetPopularTags } from "@/api/tag";
+import { PATH } from "@/common/utils";
+import type { RecentSearch } from "../../hooks";
import { SearchPopularItem } from "./SearchPopularItem";
interface Props {
diff --git a/src/components/search/SearchPopular/index.ts b/src/features/search/components/SearchPopularList/index.ts
similarity index 100%
rename from src/components/search/SearchPopular/index.ts
rename to src/features/search/components/SearchPopularList/index.ts
diff --git a/src/components/search/SearchRecent/SearchRecent.tsx b/src/features/search/components/SearchRecent.tsx
similarity index 86%
rename from src/components/search/SearchRecent/SearchRecent.tsx
rename to src/features/search/components/SearchRecent.tsx
index bd5b4078..ff21f32e 100644
--- a/src/components/search/SearchRecent/SearchRecent.tsx
+++ b/src/features/search/components/SearchRecent.tsx
@@ -1,11 +1,11 @@
import { useRouter } from "next/router";
-import type { RecentSearch } from "@/application/hooks";
-import { isTagType } from "@/application/hooks";
-import { PATH } from "@/application/util";
-import { Icon } from "@/components/common/Icon";
+import { Icon } from "@/common/components/Icon";
+import { PATH } from "@/common/utils";
-import { SearchItem } from "../SearchItem";
+import type { RecentSearch } from "../hooks";
+import { isTagType } from "../hooks";
+import { SearchItem } from "./SearchItem";
interface Props {
items: RecentSearch[];
diff --git a/src/components/search/SearchResult/SearchResultList.tsx b/src/features/search/components/SearchResultList.tsx
similarity index 77%
rename from src/components/search/SearchResult/SearchResultList.tsx
rename to src/features/search/components/SearchResultList.tsx
index 00f07d3d..e65485e5 100644
--- a/src/components/search/SearchResult/SearchResultList.tsx
+++ b/src/features/search/components/SearchResultList.tsx
@@ -1,10 +1,11 @@
import Link from "next/link";
-import type { RecentSearch } from "@/application/hooks";
-import { useGetTagSearch } from "@/application/hooks";
-import { PATH } from "@/application/util";
-import { Icon } from "@/components/common/Icon";
-import { SearchItem } from "@/components/search";
+import { useGetTagSearch } from "@/api/tag";
+import { Icon } from "@/common/components/Icon";
+import { PATH } from "@/common/utils";
+
+import type { RecentSearch } from "../hooks";
+import { SearchItem } from "./SearchItem";
interface Prop {
value: string;
diff --git a/src/components/search/Skeleton/SkeletonTagList.tsx b/src/features/search/components/Skeleton/SkeletonTagList.tsx
similarity index 86%
rename from src/components/search/Skeleton/SkeletonTagList.tsx
rename to src/features/search/components/Skeleton/SkeletonTagList.tsx
index 57dfb3d5..8b16184b 100644
--- a/src/components/search/Skeleton/SkeletonTagList.tsx
+++ b/src/features/search/components/Skeleton/SkeletonTagList.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/common/Skeleton";
+import { Skeleton } from "@/common/components/Skeleton";
export const SkeletonTagList = () => {
return (
diff --git a/src/components/search/Skeleton/index.ts b/src/features/search/components/Skeleton/index.ts
similarity index 100%
rename from src/components/search/Skeleton/index.ts
rename to src/features/search/components/Skeleton/index.ts
diff --git a/src/features/search/components/index.ts b/src/features/search/components/index.ts
new file mode 100644
index 00000000..b410eaed
--- /dev/null
+++ b/src/features/search/components/index.ts
@@ -0,0 +1,6 @@
+export * from "./SearchInput";
+export * from "./SearchItem";
+export * from "./SearchPopularList";
+export * from "./SearchRecent";
+export * from "./SearchResultList";
+export * from "./Skeleton";
diff --git a/src/application/hooks/domain/search/index.ts b/src/features/search/hooks/index.ts
similarity index 100%
rename from src/application/hooks/domain/search/index.ts
rename to src/features/search/hooks/index.ts
diff --git a/src/application/hooks/domain/search/useRecentSearch/index.ts b/src/features/search/hooks/useRecentSearch/index.ts
similarity index 100%
rename from src/application/hooks/domain/search/useRecentSearch/index.ts
rename to src/features/search/hooks/useRecentSearch/index.ts
diff --git a/src/application/hooks/domain/search/useRecentSearch/types.ts b/src/features/search/hooks/useRecentSearch/types.ts
similarity index 100%
rename from src/application/hooks/domain/search/useRecentSearch/types.ts
rename to src/features/search/hooks/useRecentSearch/types.ts
diff --git a/src/application/hooks/domain/search/useRecentSearch/useRecentSearch.ts b/src/features/search/hooks/useRecentSearch/useRecentSearch.ts
similarity index 94%
rename from src/application/hooks/domain/search/useRecentSearch/useRecentSearch.ts
rename to src/features/search/hooks/useRecentSearch/useRecentSearch.ts
index c24475f4..bf1fdddb 100644
--- a/src/application/hooks/domain/search/useRecentSearch/useRecentSearch.ts
+++ b/src/features/search/hooks/useRecentSearch/useRecentSearch.ts
@@ -1,4 +1,4 @@
-import { useLocalStorage } from "@/application/hooks/common";
+import { useLocalStorage } from "@/common/hooks";
import type { RecentSearch } from "./types";
diff --git a/src/application/hooks/domain/search/useRecentSearch/utils.ts b/src/features/search/hooks/useRecentSearch/utils.ts
similarity index 100%
rename from src/application/hooks/domain/search/useRecentSearch/utils.ts
rename to src/features/search/hooks/useRecentSearch/utils.ts
diff --git a/src/components/share/SharedMemeList.tsx b/src/features/share/components/SharedMemeList.tsx
similarity index 76%
rename from src/components/share/SharedMemeList.tsx
rename to src/features/share/components/SharedMemeList.tsx
index 6ece3a2d..13953f5c 100644
--- a/src/components/share/SharedMemeList.tsx
+++ b/src/features/share/components/SharedMemeList.tsx
@@ -1,5 +1,5 @@
-import { useGetMemesByCollectionId } from "@/application/hooks";
-import { InfiniteMemeList } from "@/components/meme";
+import { useGetMemesByCollectionId } from "@/api/meme";
+import { InfiniteMemeList } from "@/features/common";
interface Props {
sharedId: number;
diff --git a/src/components/share/index.ts b/src/features/share/components/index.ts
similarity index 100%
rename from src/components/share/index.ts
rename to src/features/share/components/index.ts
diff --git a/src/infra/api/auth/index.ts b/src/infra/api/auth/index.ts
index b7557fdd..6e4db499 100644
--- a/src/infra/api/auth/index.ts
+++ b/src/infra/api/auth/index.ts
@@ -1,7 +1,7 @@
import type { AxiosInstance, AxiosRequestConfig } from "axios";
import { isAxiosError } from "axios";
-import { IS_CSR } from "@/application/util";
+import { IS_CSR } from "@/common/utils";
import type { RefreshResponse } from "@/infra/api/auth/types";
export class AuthApi {
diff --git a/src/infra/api/tags/index.ts b/src/infra/api/tags/index.ts
index 615ef7ff..fc36e5ae 100644
--- a/src/infra/api/tags/index.ts
+++ b/src/infra/api/tags/index.ts
@@ -6,6 +6,7 @@ import type {
GetMemeTagsByIdResponse,
GetPopularTagsResponse,
GetTagInfoResponse,
+ GetTagSearchResponse,
} from "./types";
export class TagApi {
@@ -25,7 +26,7 @@ export class TagApi {
}
//NOTE : api response에 categoryName 없음 check
return this.api
- .get("/tags/search", {
+ .get("/tags/search", {
params: {
word: value,
},
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index c1ff7e0a..689c912e 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -5,15 +5,15 @@ import Head from "next/head";
import { useRouter } from "next/router";
import { useEffect } from "react";
-import { OverlayProvider, RouteTrackingProvider, useAnalytics } from "@/application/hooks";
-import { QueryClientProvider } from "@/application/queryClient";
-import { QueryErrorBoundary } from "@/components/common/ErrorBoundary";
-import { Layout } from "@/components/common/Layout";
-import { SignUpModal, SignUpModalProvider } from "@/components/common/Modal";
-import { ToastContainer, ToastProvider } from "@/components/common/Toast";
-import { TagCategoryProvider } from "@/components/tags";
-import { GoogleTagManagerScript, GTagScript } from "@/infra/sdk";
-import type { DefaultPageProps } from "@/types";
+import type { DefaultPageProps } from "@/api/core";
+import { QueryClientProvider } from "@/api/core";
+import { QueryErrorBoundary } from "@/common/components/ErrorBoundary";
+import { Layout } from "@/common/components/Layout";
+import { SignUpModal, SignUpModalProvider } from "@/common/components/Modal";
+import { ToastContainer, ToastProvider } from "@/common/components/Toast";
+import { OverlayProvider, RouteTrackingProvider, useAnalytics } from "@/common/hooks";
+import { GoogleTagManagerScript, GTagScript } from "@/common/libs";
+import { TagCategoryProvider } from "@/features/common";
if (process.env.NEXT_PUBLIC_API_MOCKING === "enabled") {
await import("../../mocks");
diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx
index 4df9477b..0b75efb9 100644
--- a/src/pages/_error.tsx
+++ b/src/pages/_error.tsx
@@ -1,7 +1,7 @@
import { captureException } from "@sentry/nextjs";
import type { NextPageContext } from "next";
-import { Navigation } from "@/components/common/Navigation";
+import { Navigation } from "@/common/components/Navigation";
interface Props {
statusCode: number;
diff --git a/src/pages/collect/index.tsx b/src/pages/collect/index.tsx
index b691b6af..b1903d41 100644
--- a/src/pages/collect/index.tsx
+++ b/src/pages/collect/index.tsx
@@ -1,12 +1,12 @@
import { useDeferredValue } from "react";
-import { useAuth, useDebounce, useInput } from "@/application/hooks";
-import { Collection, SearchedCollection } from "@/components/collect";
-import { BackButtonNavigation } from "@/components/common/Navigation";
-import { MemeListSkeleton } from "@/components/common/Skeleton";
-import { SSRSuspense } from "@/components/common/Suspense";
-import { withAuth } from "@/components/hocs";
-import { SearchInput } from "@/components/search";
+import { BackButtonNavigation } from "@/common/components/Navigation";
+import { MemeListSkeleton } from "@/common/components/Skeleton";
+import { SSRSuspense } from "@/common/components/Suspense";
+import { useDebounce, useInput } from "@/common/hooks";
+import { Collection, SearchedCollection } from "@/features/collect/components";
+import { useAuth, withAuth } from "@/features/common";
+import { SearchInput } from "@/features/search/components";
const CollectPage = () => {
const inputProps = useInput();
diff --git a/src/pages/explore/keywords/index.tsx b/src/pages/explore/keywords/index.tsx
index 6d7a9cd0..592f8711 100644
--- a/src/pages/explore/keywords/index.tsx
+++ b/src/pages/explore/keywords/index.tsx
@@ -1,13 +1,13 @@
import type { GetServerSideProps, NextPage } from "next";
-import { DEFAULT_DESCRIPTION, SITE_NAME } from "@/application/util";
-import { ExplorePageNavigation } from "@/components/common/Navigation";
-import type { NextSeoProps } from "@/components/common/NextSeo";
-import { NextSeo } from "@/components/common/NextSeo";
-import { PullToRefresh } from "@/components/common/PullToRefresh";
-import { MemeListSkeleton } from "@/components/common/Skeleton";
-import { SSRSuspense } from "@/components/common/Suspense";
-import { MemesByKeyword } from "@/components/explore";
+import { ExplorePageNavigation } from "@/common/components/Navigation";
+import type { NextSeoProps } from "@/common/components/NextSeo";
+import { NextSeo } from "@/common/components/NextSeo";
+import { PullToRefresh } from "@/common/components/PullToRefresh";
+import { MemeListSkeleton } from "@/common/components/Skeleton";
+import { SSRSuspense } from "@/common/components/Suspense";
+import { DEFAULT_DESCRIPTION, SITE_NAME } from "@/common/utils";
+import { MemesByKeyword } from "@/features/explore/keywords/components";
interface Props {
searchQuery: string;
diff --git a/src/pages/explore/tags/[tagId].tsx b/src/pages/explore/tags/[tagId].tsx
index 653a34af..095d6326 100644
--- a/src/pages/explore/tags/[tagId].tsx
+++ b/src/pages/explore/tags/[tagId].tsx
@@ -1,13 +1,13 @@
import { dehydrate, QueryClient } from "@tanstack/react-query";
import type { GetStaticPaths, GetStaticProps, NextPage } from "next";
-import { fetchTagInfo, prefetchMemesByTag } from "@/application/hooks";
-import { DEFAULT_DESCRIPTION, SITE_NAME } from "@/application/util";
-import { ExplorePageNavigation } from "@/components/common/Navigation";
-import { NextSeo } from "@/components/common/NextSeo";
-import { PullToRefresh } from "@/components/common/PullToRefresh";
-import { MemesByTag, Thumbnail } from "@/components/explore";
-import { TagBookmarkButton } from "@/components/tags";
+import { useGetMemesByTag } from "@/api/search";
+import { useGetTagInfo } from "@/api/tag";
+import { ExplorePageNavigation } from "@/common/components/Navigation";
+import { NextSeo } from "@/common/components/NextSeo";
+import { PullToRefresh } from "@/common/components/PullToRefresh";
+import { DEFAULT_DESCRIPTION, SITE_NAME } from "@/common/utils";
+import { MemesByTag, TagBookmarkButton, Thumbnail } from "@/features/explore/tags/components";
interface Props {
searchQuery: string;
@@ -58,10 +58,10 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
}
try {
- const { name: tagName } = await fetchTagInfo(Number(tagId), queryClient);
+ const { name: tagName } = await useGetTagInfo.fetchQuery(Number(tagId), queryClient);
// NOTE: tag name 이 api request 값이기 때문에 waterfall 한 fetching 이 필요합니다
- await prefetchMemesByTag(tagName, queryClient);
+ await useGetMemesByTag.fetchInfiniteQuery(tagName, queryClient);
return {
props: {
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 41311072..c8c0d1d4 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -1,11 +1,11 @@
import type { NextPage } from "next";
-import { DEFAULT_DESCRIPTION, SITE_NAME } from "@/application/util";
-import { IntroPageNavigation } from "@/components/common/Navigation";
-import type { NextSeoProps } from "@/components/common/NextSeo";
-import { NextSeo } from "@/components/common/NextSeo";
-import { PullToRefresh } from "@/components/common/PullToRefresh";
-import { MemeListContainer } from "@/components/home";
+import { IntroPageNavigation } from "@/common/components/Navigation";
+import type { NextSeoProps } from "@/common/components/NextSeo";
+import { NextSeo } from "@/common/components/NextSeo";
+import { PullToRefresh } from "@/common/components/PullToRefresh";
+import { DEFAULT_DESCRIPTION, SITE_NAME } from "@/common/utils";
+import { MemeListContainer } from "@/features/home/components";
const HomePage: NextPage = () => {
return (
diff --git a/src/pages/memes/[id].tsx b/src/pages/memes/[id].tsx
index 17d3711a..041ace35 100644
--- a/src/pages/memes/[id].tsx
+++ b/src/pages/memes/[id].tsx
@@ -2,12 +2,15 @@ import { dehydrate, QueryClient } from "@tanstack/react-query";
import type { GetStaticPaths, GetStaticProps, NextPage } from "next";
import { Suspense } from "react";
-import { fetchMemeDetailById, fetchMemeTagsById, useMoveMemeDetail } from "@/application/hooks";
-import { SITE_NAME } from "@/application/util";
-import { ExplorePageNavigation } from "@/components/common/Navigation";
-import { NextSeo } from "@/components/common/NextSeo";
-import { MemeListSkeleton, Skeleton } from "@/components/common/Skeleton";
-import { SSRSuspense } from "@/components/common/Suspense";
+import type { DefaultPageProps } from "@/api/core";
+import { useGetMemeDetailById } from "@/api/meme";
+import { useGetMemeTagsById } from "@/api/tag";
+import { ExplorePageNavigation } from "@/common/components/Navigation";
+import { NextSeo } from "@/common/components/NextSeo";
+import { MemeListSkeleton, Skeleton } from "@/common/components/Skeleton";
+import { SSRSuspense } from "@/common/components/Suspense";
+import { SITE_NAME } from "@/common/utils";
+import { useMoveMemeDetail } from "@/features/common";
import {
MemeCTAList,
MemeDetail,
@@ -15,8 +18,8 @@ import {
RelativeMemeList,
SkeletonMemeDetail,
SkeletonMemeTagList,
-} from "@/components/meme";
-import type { DefaultPageProps, Meme } from "@/types";
+} from "@/features/memes/components";
+import type { Meme } from "@/types";
interface Props {
id: string;
@@ -86,8 +89,8 @@ export const getStaticProps: GetStaticProps<
try {
const [{ description, name, image }] = await Promise.all([
- fetchMemeDetailById(id, queryClient),
- fetchMemeTagsById(id, queryClient),
+ useGetMemeDetailById.fetchQuery(id, queryClient),
+ useGetMemeTagsById.fetchQuery(id, queryClient),
]);
return {
diff --git a/src/pages/mypage/index.tsx b/src/pages/mypage/index.tsx
index 606c17cc..0877649b 100644
--- a/src/pages/mypage/index.tsx
+++ b/src/pages/mypage/index.tsx
@@ -1,14 +1,13 @@
import Link from "next/link";
import { css } from "twin.macro";
-import { useAuth, useChannelIO } from "@/application/hooks";
-import { Icon } from "@/components/common/Icon";
-import { MyPageNavigation } from "@/components/common/Navigation";
-import { Photo } from "@/components/common/Photo";
-import { MemeListSkeleton, Skeleton } from "@/components/common/Skeleton";
-import { SSRSuspense } from "@/components/common/Suspense";
-import { withAuth } from "@/components/hocs";
-import { SummarizedCollection } from "@/components/mypage";
+import { Icon } from "@/common/components/Icon";
+import { MyPageNavigation } from "@/common/components/Navigation";
+import { Photo } from "@/common/components/Photo";
+import { MemeListSkeleton, Skeleton } from "@/common/components/Skeleton";
+import { SSRSuspense } from "@/common/components/Suspense";
+import { useAuth, useChannelIO, withAuth } from "@/features/common";
+import { SummarizedCollection } from "@/features/mypage/components";
const MyPage = () => {
const { isLoading, user } = useAuth();
diff --git a/src/pages/oauth2/redirect/index.tsx b/src/pages/oauth2/redirect/index.tsx
index e6f75b0c..90cab596 100644
--- a/src/pages/oauth2/redirect/index.tsx
+++ b/src/pages/oauth2/redirect/index.tsx
@@ -1,7 +1,7 @@
import Router from "next/router";
import React, { useEffect } from "react";
-import { useAuth } from "@/application/hooks";
+import { useAuth } from "@/features/common";
const KaKaoRedirect = () => {
const { login } = useAuth();
diff --git a/src/pages/search/index.tsx b/src/pages/search/index.tsx
index 0af014f6..3eebe1ae 100644
--- a/src/pages/search/index.tsx
+++ b/src/pages/search/index.tsx
@@ -2,19 +2,20 @@ import type { NextPage } from "next";
import { useRouter } from "next/router";
import { Suspense } from "react";
-import { useDebounce, useInput, useRecentSearch } from "@/application/hooks";
-import { DEFAULT_DESCRIPTION, PATH, SITE_NAME } from "@/application/util";
-import { SearchPageNavigation } from "@/components/common/Navigation";
-import type { NextSeoProps } from "@/components/common/NextSeo";
-import { NextSeo } from "@/components/common/NextSeo";
-import { SSRSuspense } from "@/components/common/Suspense";
+import { SearchPageNavigation } from "@/common/components/Navigation";
+import type { NextSeoProps } from "@/common/components/NextSeo";
+import { NextSeo } from "@/common/components/NextSeo";
+import { SSRSuspense } from "@/common/components/Suspense";
+import { useDebounce, useInput } from "@/common/hooks";
+import { DEFAULT_DESCRIPTION, PATH, SITE_NAME } from "@/common/utils";
import {
SearchInput,
SearchPopularList,
SearchRecent,
SearchResultList,
-} from "@/components/search";
-import { SkeletonTagList } from "@/components/search/Skeleton";
+ SkeletonTagList,
+} from "@/features/search/components";
+import { useRecentSearch } from "@/features/search/hooks";
/**
* FIX
diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx
index b10225ec..11aa2272 100644
--- a/src/pages/setting/index.tsx
+++ b/src/pages/setting/index.tsx
@@ -1,9 +1,9 @@
-import { useAuth, useChannelIO, useModal } from "@/application/hooks";
-import { Button } from "@/components/common/Button";
-import { SignOutModal } from "@/components/common/Modal";
-import { BackButtonNavigation } from "@/components/common/Navigation";
-import { Photo } from "@/components/common/Photo";
-import { withAuth } from "@/components/hocs";
+import { Button } from "@/common/components/Button";
+import { SignOutModal } from "@/common/components/Modal";
+import { BackButtonNavigation } from "@/common/components/Navigation";
+import { Photo } from "@/common/components/Photo";
+import { useModal } from "@/common/hooks";
+import { useAuth, useChannelIO, withAuth } from "@/features/common";
const SettingPage = () => {
const modalProps = useModal();
diff --git a/src/pages/share/index.tsx b/src/pages/share/index.tsx
index 0e45d561..fbd98830 100644
--- a/src/pages/share/index.tsx
+++ b/src/pages/share/index.tsx
@@ -1,11 +1,10 @@
import type { NextPage } from "next";
-import { useAuth } from "@/application/hooks";
-import { BackButtonNavigation } from "@/components/common/Navigation";
-import { MemeListSkeleton } from "@/components/common/Skeleton";
-import { SSRSuspense } from "@/components/common/Suspense";
-import { withAuth } from "@/components/hocs";
-import { SharedMemeList } from "@/components/share";
+import { BackButtonNavigation } from "@/common/components/Navigation";
+import { MemeListSkeleton } from "@/common/components/Skeleton";
+import { SSRSuspense } from "@/common/components/Suspense";
+import { useAuth, withAuth } from "@/features/common";
+import { SharedMemeList } from "@/features/share/components";
const SharedHistoryPage: NextPage = () => {
const { user } = useAuth();
diff --git a/src/types/index.d.ts b/src/types/index.d.ts
index f822ec27..5b69e55b 100644
--- a/src/types/index.d.ts
+++ b/src/types/index.d.ts
@@ -1,11 +1,3 @@
-import type { ComponentProps } from "react";
-
-import type { QueryClientProvider } from "@/application/queryClient";
-
-export interface DefaultPageProps {
- hydrateState: ComponentProps["hydrateState"];
-}
-
export interface Meme {
memeId: number;
name: string;
diff --git a/tailwind.config.js b/tailwind.config.js
index 4bce28a1..4ca338e0 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -9,8 +9,8 @@ const PX0_50 = { ...Array.from(Array(51)).map((_, i) => `${i / 10}rem`) };
module.exports = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx}",
- "./src/components/**/*.{js,ts,jsx,tsx}",
- "./src/application/**/*.{js,ts,jsx,tsx}",
+ "./src/features/**/*.{js,ts,jsx,tsx}",
+ "./src/common/**/*.{js,ts,jsx,tsx}",
],
safelist: [{ pattern: /line-clamp-/ }],
theme: {