Skip to content

Commit f9b5776

Browse files
committed
refactor: 플랜을 불러오는 중에 플랜을 추가하지 못하도록 수정
1 parent 2868abd commit f9b5776

1 file changed

Lines changed: 35 additions & 32 deletions

File tree

app/(with-sidebar)/plans/page.tsx

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -147,39 +147,42 @@ const Page = () => {
147147
{/* 검색 바 */}
148148
<SearchBar />
149149

150-
{/* 메인 플랜 목록 */}
151-
<section className="space-y-6">
152-
{isLoading ? (
153-
<p>플랜을 불러오는 중...</p>
154-
) : plans.length > 0 && user ? (
155-
plans.map((plan) => (
156-
<PlanSection
157-
key={plan.id}
158-
userId={user.uid}
159-
planId={plan.id}
160-
title={plan.title}
161-
description={plan.description}
162-
onDelete={handleDeletePlan}
163-
/>
164-
))
165-
) : (
166-
<p>아직 생성된 플랜이 없습니다. 첫 플랜을 추가해보세요!</p>
167-
)}
168-
</section>
169-
170-
{/* 하단 추가 버튼 or 인라인 폼 */}
171-
<div className="mt-6">
172-
{isAdding ? (
173-
<InlineAddPlanForm
174-
onSave={handleSavePlan}
175-
onCancel={handleCancelAdd}
176-
/>
177-
) : (
178-
<div onClick={() => setIsAdding(true)}>
179-
<AddPlanButton />
150+
{isLoading ? (
151+
<p>플랜을 불러오는 중...</p>
152+
) : (
153+
<div>
154+
<section className="space-y-6">
155+
{plans.length > 0 && user ? (
156+
plans.map((plan) => (
157+
<PlanSection
158+
key={plan.id}
159+
userId={user.uid}
160+
planId={plan.id}
161+
title={plan.title}
162+
description={plan.description}
163+
onDelete={handleDeletePlan}
164+
/>
165+
))
166+
) : (
167+
<p>아직 생성된 플랜이 없습니다. 첫 플랜을 추가해보세요!</p>
168+
)}
169+
</section>
170+
171+
{/* 하단 추가 버튼 or 인라인 폼 */}
172+
<div className="mt-6">
173+
{isAdding ? (
174+
<InlineAddPlanForm
175+
onSave={handleSavePlan}
176+
onCancel={handleCancelAdd}
177+
/>
178+
) : (
179+
<div onClick={() => setIsAdding(true)}>
180+
<AddPlanButton />
181+
</div>
182+
)}
180183
</div>
181-
)}
182-
</div>
184+
</div>
185+
)}
183186
</div>
184187
);
185188
};

0 commit comments

Comments
 (0)