Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/(main)/calendar/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryKeys';
import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryFunction';
import CalendarClient from '@/features/calendar/components/CalendarClient';
import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/dashboard/all-todo/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query

import AllTodoContent from '@/features/dashboard/allTodo/components/AllTodoContent';

import { todoQueries } from '@/shared/lib/query/queryKeys';
import { todoQueries } from '@/shared/lib/query/queryFunction';

export const dynamic = 'force-dynamic';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/dashboard/favorite-todo/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query

import FavoriteTodoContent from '@/features/dashboard/favorite-todo/components/FavoriteTodoContent';

import { todoQueries } from '@/shared/lib/query/queryKeys';
import { todoQueries } from '@/shared/lib/query/queryFunction';

export const dynamic = 'force-dynamic';

Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import DashboardDetail from '@/features/dashboard/components/DashboardDetail';
import DashboardDetailSkeleton from '@/features/dashboard/components/DashboardDetailSkeleton';

import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary';
import { dashboardQueries } from '@/shared/lib/query/queryKeys';
import { dashboardQueries } from '@/shared/lib/query/queryFunction';

export const dynamic = 'force-dynamic';

/**
* @description 해당 페이지는 서버 컴포넌트입니다. 클라이언트 컴포넌트로 변경하지 말아주세요
* 'use client'로 변경 x
* 'use client'로 변경x
*/

export default async function DashboardPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dehydrate, QueryClient, HydrationBoundary } from '@tanstack/react-query';
import { noteQueries, goalQueries } from '@/shared/lib/query/queryKeys';
import { noteQueries, goalQueries } from '@/shared/lib/query/queryFunction';
import NoteDetailClient from '@/features/note/components/NoteDetailClient';
import { notFound } from 'next/navigation';
import NoteDetailModal from '@/features/note/components/NoteDetailModal';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dehydrate, QueryClient, HydrationBoundary } from '@tanstack/react-query';
import { noteQueries, goalQueries } from '@/shared/lib/query/queryKeys';
import { noteQueries, goalQueries } from '@/shared/lib/query/queryFunction';
import NoteDetailClient from '@/features/note/components/NoteDetailClient';
import { notFound } from 'next/navigation';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/goal/[goalId]/note/[noteId]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
import { noteQueries, goalQueries, todoQueries } from '@/shared/lib/query/queryKeys';
import { noteQueries, goalQueries, todoQueries } from '@/shared/lib/query/queryFunction';
import NoteEditClient from '@/features/note/components/NoteEditClient';
import { notFound } from 'next/navigation';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/goal/[goalId]/note/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query';
import { noteQueries, goalQueries } from '@/shared/lib/query/queryKeys';
import { noteQueries, goalQueries } from '@/shared/lib/query/queryFunction';
import NoteListContainer from '@/features/note/components/NoteListContainer';
import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/goal/[goalId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query
import GoalSummary from '@/features/goal/components/GoalSummary';
import GoalDetail from '@/features/goal/components/GoalDetail';

import { userQueries, goalQueries } from '@/shared/lib/query/queryKeys';
import { userQueries, goalQueries } from '@/shared/lib/query/queryFunction';

/**
* @description 해당 페이지는 서버 컴포넌트입니다. 클라이언트 컴포넌트로 변경하지 말아주세요
Expand Down
14 changes: 8 additions & 6 deletions src/app/(main)/mypage/MyPageForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Button from '@/shared/components/Button';
import FormField from '@/shared/components/FormField';
import LoadingSpinner from '@/shared/components/LoadingSpinner';

import { userQueries } from '@/shared/lib/query/queryKeys';
import { userQueries } from '@/shared/lib/query/queryFunction';
import {
useDeleteGithubConnection,
usePatchCurrentUser,
Expand Down Expand Up @@ -186,7 +186,7 @@ export default function MyPageForm() {
<div className="flex flex-col gap-10">
{!isMobile && <PageHeader title={t.mypage.title} />}

<div className="flex min-h-219.5 w-140 flex-col gap-6 rounded-2xl bg-white p-8 dark:bg-gray-850">
<div className="dark:bg-gray-850 flex min-h-219.5 w-140 flex-col gap-6 rounded-2xl bg-white p-8">
{/* 프로필 이미지 */}
<div className="flex justify-center">
<div className="relative h-33 w-33">
Expand Down Expand Up @@ -241,7 +241,9 @@ export default function MyPageForm() {
onChange={handleNicknameChange}
placeholder={t.mypage.nicknamePlaceholder}
/>
{nicknameSuccess && <p className="px-1 text-sm text-[#0CAF60] dark:text-[#009D97]">{t.mypage.nicknameSuccess}</p>}
{nicknameSuccess && (
<p className="px-1 text-sm text-[#0CAF60] dark:text-[#009D97]">{t.mypage.nicknameSuccess}</p>
)}
</FormField>

{/* 비밀번호 변경 - 소셜 로그인이면 숨김 */}
Expand Down Expand Up @@ -279,7 +281,7 @@ export default function MyPageForm() {
<Button
variant="primary"
type="button"
className="h-14 w-full text-lg dark:text-gray-850"
className="dark:text-gray-850 h-14 w-full text-lg"
onClick={handleSave}
disabled={isPatchingUser || isPatchingPassword}
aria-label={t.mypage.save}
Expand All @@ -290,7 +292,7 @@ export default function MyPageForm() {
<button
type="button"
onClick={handleAccountDelete}
className="h-14 w-full rounded-full bg-gray-100 text-lg font-medium text-gray-500 hover:bg-gray-200 dark:bg-gray-750 dark:text-[#DFDFDF] dark:hover:bg-gray-700"
className="dark:bg-gray-750 h-14 w-full rounded-full bg-gray-100 text-lg font-medium text-gray-500 hover:bg-gray-200 dark:text-[#DFDFDF] dark:hover:bg-gray-700"
>
{t.mypage.withdraw}
</button>
Expand All @@ -316,7 +318,7 @@ export default function MyPageForm() {
<button
type="button"
onClick={handleGithubConnect}
className="rounded-full border border-gray-200 px-4 py-1.5 text-sm text-gray-500 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-750"
className="dark:hover:bg-gray-750 rounded-full border border-gray-200 px-4 py-1.5 text-sm text-gray-500 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400"
>
{t.mypage.connect}
</button>
Expand Down
18 changes: 18 additions & 0 deletions src/app/api/dashboard/detail/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NextResponse } from 'next/server';

import { getDashboardDetailTodos } from '@/shared/lib/customApi/getDashboardDetailTodos';

export async function GET() {
try {
const result = await getDashboardDetailTodos();

return NextResponse.json(result, {
status: result.hasAnySuccess ? 200 : 502,
headers: {
'Cache-Control': 'no-store',
},
});
} catch {
return NextResponse.json({ message: 'Failed to fetch dashboard detail todos' }, { status: 502 });
}
}
4 changes: 2 additions & 2 deletions src/app/api/dashboard/summary/route.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { NextResponse } from 'next/server';

import { fetchDashboard } from '@/shared/lib/api/fetchDashboard';
import { getDashboardSummaryResult } from '@/shared/lib/customApi/getDashboardSummaryResult';

export async function GET() {
try {
const result = await fetchDashboard.getDashboardSummaryResult();
const result = await getDashboardSummaryResult();

return NextResponse.json(result, {
status: result.hasAnySuccess ? 200 : 502,
Expand Down
2 changes: 1 addition & 1 deletion src/features/calendar/hooks/useCalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryKeys';
import { todoQueries, goalQueries, userQueries } from '@/shared/lib/query/queryFunction';

export function useCalendar() {
const today = new Date();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DataBoundary } from '@/shared/components/ErrorSuspenseBoundary';
import PageHeader from '@/shared/components/PageHeader';
import TaskCardWrapper from '@/features/dashboard/components/TaskCardWrapper';

import { goalQueries, todoQueries } from '@/shared/lib/query/queryKeys';
import { goalQueries, todoQueries } from '@/shared/lib/query/queryFunction';
import { useTodoCreateModal } from '@/features/todo/hooks/useTodoCreateModal';
import type { TodoListResponse } from '@/shared/lib/api';
import { TodoOptions } from '@/shared/types/types';
Expand Down Expand Up @@ -40,7 +40,7 @@ export default function AllTodoContent() {
<section className="flex flex-col gap-3">
<AllTodoFilter todos={allTodos} selectedFilter={selectedFilter} setSelectedFilter={setSelectedFilter} />
{allTodos.length === 0 ? (
<section className="rounded-4xl bg-white dark:bg-gray-850 p-4 md:p-8 w-full max-w-180 h-204 flex items-center justify-center">
<section className="dark:bg-gray-850 flex h-204 w-full max-w-180 items-center justify-center rounded-4xl bg-white p-4 md:p-8">
<Empty>{t.allTodo.empty}</Empty>
</section>
) : (
Expand Down Expand Up @@ -94,7 +94,7 @@ function AllTodoFilter({ todos, selectedFilter, setSelectedFilter }: AllTodoFilt
</div>
<Button
variant="cancel"
className="group hover:bg-bearlog-500 flex items-center gap-1 bg-[#F2F2F2] dark:bg-bearlog-500 dark:border-transparent px-3 py-[10px] md:px-[20px]"
className="group hover:bg-bearlog-500 dark:bg-bearlog-500 flex items-center gap-1 bg-[#F2F2F2] px-3 py-[10px] md:px-[20px] dark:border-transparent"
disabled={!defaultGoalId}
onClick={() => {
if (!defaultGoalId) return;
Expand All @@ -112,8 +112,8 @@ function AllTodoFilter({ todos, selectedFilter, setSelectedFilter }: AllTodoFilt
});
}}
>
<PlusIcon size={20} className="text-gray-500 dark:text-gray-850 group-hover:text-white" />
<span className="overflow-hidden text-sm font-semibold text-ellipsis whitespace-nowrap text-gray-500 dark:text-gray-850 group-hover:text-white">
<PlusIcon size={20} className="dark:text-gray-850 text-gray-500 group-hover:text-white" />
<span className="dark:text-gray-850 overflow-hidden text-sm font-semibold text-ellipsis whitespace-nowrap text-gray-500 group-hover:text-white">
{t.allTodo.addTodo}
</span>
</Button>
Expand Down Expand Up @@ -149,7 +149,7 @@ function AllTodoFetcher({ todos, fetchNextPage, hasNextPage, isFetchingNextPage
}, [hasNextPage, isFetchingNextPage, fetchNextPage]);

return (
<section className="rounded-4xl bg-white dark:bg-gray-850 p-4 md:p-8">
<section className="dark:bg-gray-850 rounded-4xl bg-white p-4 md:p-8">
<div className="mb-6 flex flex-col items-center rounded-2xl bg-[#C6D7D11C] py-[10px]">
<span className="text-sm text-[#AFB6B4B8]">{t.allTodo.issueReopenNotice1}</span>
<span className="text-sm text-[#AFB6B4B8]">{t.allTodo.issueReopenNotice2}</span>
Expand Down
20 changes: 5 additions & 15 deletions src/features/dashboard/components/DashboardDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ import Empty from '@/shared/components/Empty';
import PageSubTitle from '@/shared/components/PageSubTitle';
import GoalBox from '../GoalBox';

import { GoalListResponse } from '@/shared/lib/api';

import { goalQueries } from '@/shared/lib/query/queryKeys';
import { dashboardQueries } from '@/shared/lib/query/queryFunction';
import { useTodoModeStore } from '@/shared/stores/useTodoModeStore';
import { useLanguage } from '@/shared/contexts/LanguageContext';
import { GITHUB_DISCONNECTED_SESSION_KEY } from '@/shared/constants/github';

export default function DashboardDetail() {
const mode = useTodoModeStore((state) => state.mode);
const { data: goals } = useQuery(goalQueries.list());
const { data: goalDetail } = useQuery(dashboardQueries.detailTodos());
const { t } = useLanguage();

const [isGithubDisconnectedSession] = useState(() => {
Expand All @@ -28,7 +26,7 @@ export default function DashboardDetail() {
const visibleGoals =
mode === 'GITHUB' && isGithubDisconnectedSession
? []
: (goals?.goals?.filter((goal) => goal.source === mode) ?? []);
: (goalDetail?.items?.filter((item) => item.goal.source === mode) ?? []);

if (mode === 'MANUAL' && visibleGoals.length === 0) {
return <Empty>{t.dashboard.noFirstGoal}</Empty>;
Expand All @@ -45,20 +43,12 @@ export default function DashboardDetail() {
icons={<Image src={'/image/goal-todo.png'} alt="Goal Icon" width={40} height={40} />}
/>
<div className="flex flex-col gap-[32px] pt-[10px]">
{visibleGoals.map((goal) => (
<GoalDetailItem key={goal.id} goal={goal} />
{visibleGoals.map((goalDetailItem) => (
<GoalBox key={goalDetailItem.goal.id} data={goalDetailItem} />
))}
</div>
</>
)}
</section>
);
}

function GoalDetailItem({ goal }: { goal: GoalListResponse['goals'][number] }) {
const { data: goalDetail } = useQuery(goalQueries.detail(goal.id));

if (!goalDetail) return null;

return <GoalBox data={goalDetail} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TaskCardWrapper from '../TaskCardWrapper';

import { useBreakpoint } from '@/shared/hooks/useBreakPoint';
import { useGithubRepoConnectModal } from '@/shared/hooks/useGithubRepoConnectModal';
import { dashboardQueries } from '@/shared/lib/query/queryKeys';
import { dashboardQueries } from '@/shared/lib/query/queryFunction';
import { useTodoModeStore, TodoMode } from '@/shared/stores/useTodoModeStore';
import { useLanguage } from '@/shared/contexts/LanguageContext';
import { DashboardSummaryResponse } from '@/shared/types/api/schemas/api.process';
Expand Down
Loading
Loading