- {follows.map((follower) => (
-
+ {follows.map((follower, index) => (
+
))}
{isFetchingNextPage && (
diff --git a/src/components/Dashboard/GoalList/index.tsx b/src/components/Dashboard/GoalList/index.tsx
index ca5ec8c0..55453d53 100644
--- a/src/components/Dashboard/GoalList/index.tsx
+++ b/src/components/Dashboard/GoalList/index.tsx
@@ -16,11 +16,21 @@ export const GoalList = () => {
useTodosOfGoalsQuery();
const { observerRef } = useInfiniteScroll({ fetchNextPage, isLoading });
+ const hasGoals = goals.length > 0;
+
return (
- {isLoading ? (
-
- ) : goals.length > 0 ? (
+ {isLoading && }
+
+ {!isLoading && !hasGoals && (
+
+
+
+
+
+ )}
+
+ {!isLoading && hasGoals && (
{goals.map((goal) => (
{
todos={goal.todos}
/>
))}
+
{isFetchingNextPage && (
)}
-
-
- ) : (
-
-
-
-
)}
diff --git a/src/components/Dashboard/RecentTodos/index.tsx b/src/components/Dashboard/RecentTodos/index.tsx
index a669601c..4b92ba18 100644
--- a/src/components/Dashboard/RecentTodos/index.tsx
+++ b/src/components/Dashboard/RecentTodos/index.tsx
@@ -10,12 +10,12 @@ import { Button } from '@/components/common/Button/Button';
import { Card } from '@/components/common/Card';
import { NoDataText } from '@/components/common/NoDataText';
+import { BasicTodoItem } from '@/components/TodosDetail/TodosDetailContent/TodoProfile/BasicTodoItem';
import { NO_DATA_MESSAGES } from '@/constants/Messages';
-import { useRecentTodosQuery } from '@/hooks/apis/Dashboard/useRecnetTodosQuery';
+import { useRecentTodosQuery } from '@/hooks/apis/Dashboard/useRecentTodosQuery';
import { useGoalsQuery } from '@/hooks/apis/useGoalsQuery';
import { useSidebarStore } from '@/store/useSidebarStore';
import { useTodoModalStore } from '@/store/useTodoModalStore';
-import { BasicTodoItem } from '@/components/TodosDetail/TodosDetailContent/TodoProfile/BasicTodoItem';
export const RecentTodos = () => {
const { todos, isLoading } = useRecentTodosQuery();
@@ -24,6 +24,9 @@ export const RecentTodos = () => {
const { open: openModal } = useTodoModalStore();
const { open: openSidebar } = useSidebarStore();
+ const hasTodos = todos.length > 0;
+ const hasGoals = goals.length > 0;
+
return (
{
>
모두 보기
- {isLoading ? (
-
- ) : goals.length === 0 ? (
+
+ {isLoading && }
+
+ {!isLoading && !hasGoals && (
- ) : todos.length === 0 ? (
+ )}
+
+ {!isLoading && hasGoals && !hasTodos && (
- ) : (
+ )}
+
+ {!isLoading && hasGoals && hasTodos && (
{todos.map((todo) => (
{
+const Sidebar = () => {
const router = useRouter();
const path = usePathname();
@@ -147,3 +147,5 @@ export const Sidebar = () => {
);
};
+
+export default Sidebar;
diff --git a/src/hooks/apis/Dashboard/useRecnetTodosQuery.ts b/src/hooks/apis/Dashboard/useRecentTodosQuery.ts
similarity index 100%
rename from src/hooks/apis/Dashboard/useRecnetTodosQuery.ts
rename to src/hooks/apis/Dashboard/useRecentTodosQuery.ts
diff --git a/src/hooks/apis/Follows/useGetFollowPostsQuery.ts b/src/hooks/apis/Follows/useGetFollowPostsQuery.ts
index c6f95d7c..f1cdd028 100644
--- a/src/hooks/apis/Follows/useGetFollowPostsQuery.ts
+++ b/src/hooks/apis/Follows/useGetFollowPostsQuery.ts
@@ -4,10 +4,10 @@ import {
} from '@tanstack/react-query';
import { AxiosError } from 'axios';
-import { GetFollowsResponse } from '@/types/Follows';
import { GET } from '@/apis/services/httpMethod';
import { API_ENDPOINTS } from '@/constants/ApiEndpoints';
import { QUERY_KEYS } from '@/constants/QueryKeys';
+import { GetFollowsResponse } from '@/types/Follows';
import { BaseInfiniteQueryResponse } from '@/types/response';
export const getFollowPostsOptions = (): UseInfiniteQueryOptions<
@@ -18,7 +18,7 @@ export const getFollowPostsOptions = (): UseInfiniteQueryOptions<
queryKey: [QUERY_KEYS.FOLLOWS],
queryFn: ({ pageParam = 0 }) =>
GET