Skip to content

Commit 1144491

Browse files
committed
feat: UI 코드 중복 제거
1 parent ce4fa57 commit 1144491

File tree

2 files changed

+46
-40
lines changed

2 files changed

+46
-40
lines changed

src/pages/deposit-search/deposit-search-page.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,29 @@ const DepositSearchPage = () => {
192192
>검색</button>
193193
</div>
194194
{/*상품 리스트*/}
195-
<div className={styles.depositListContainer}>
196-
{depositList.length > 0 ? (
197-
depositList.map(item => (
198-
<DepositBasic
199-
key={`${item.productId}-${item.optionId}`}
200-
productId={item.productId}
201-
optionId={item.optionId}
202-
bankName={item.bankName}
203-
productName={item.productName}
204-
saveTerm={item.saveTerm}
205-
baseRate={item.baseRate}
206-
maxRate={item.maxRate}
207-
/>
208-
))
209-
) : (
210-
<p>검색된 예금 상품이 없습니다.</p>
211-
)}
212-
</div>
195+
{!loading && (
196+
<div className={styles.depositListContainer}>
197+
{depositList.length > 0 ? (
198+
depositList.map(item => (
199+
<DepositBasic
200+
key={`${item.productId}-${item.optionId}`}
201+
productId={item.productId}
202+
optionId={item.optionId}
203+
bankName={item.bankName}
204+
productName={item.productName}
205+
saveTerm={item.saveTerm}
206+
baseRate={item.baseRate}
207+
maxRate={item.maxRate}
208+
/>
209+
))
210+
) : (
211+
<p>검색된 예금 상품이 없습니다.</p>
212+
)}
213+
</div>
214+
)}
213215
</main>
214216
</>
215-
)};
217+
);
218+
};
216219

217220
export default DepositSearchPage;

src/pages/savings-search/savings-search-page.tsx

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,31 +188,34 @@ const SavingSearchPage = () => {
188188
<button
189189
className={`${styles.searchButton} ${button({variant:'blue'})}`}
190190
onClick={handleSearch}
191-
disabled={loading}
191+
192192
>검색</button>
193193
</div>
194194
{/*상품 리스트*/}
195-
<div className={styles.savingListContainer}>
196-
{savingList.length > 0 ? (
197-
savingList.map(item => (
198-
<SavingBasic
199-
key={`${item.productId}-${item.optionId}`}
200-
productId={item.productId}
201-
optionId={item.optionId}
202-
bankName={item.bankName}
203-
productName={item.productName}
204-
rsrvTypeNm={item.rsrvTypeNm}
205-
saveTerm={item.saveTerm}
206-
baseRate={item.baseRate}
207-
maxRate={item.maxRate}
208-
/>
209-
))
210-
) : (
211-
<p>검색된 적금 상품이 없습니다.</p>
212-
)}
213-
</div>
195+
{!loading && (
196+
<div className={styles.savingListContainer}>
197+
{savingList.length > 0 ? (
198+
savingList.map(item => (
199+
<SavingBasic
200+
key={`${item.productId}-${item.optionId}`}
201+
productId={item.productId}
202+
optionId={item.optionId}
203+
bankName={item.bankName}
204+
productName={item.productName}
205+
rsrvTypeNm={item.rsrvTypeNm}
206+
saveTerm={item.saveTerm}
207+
baseRate={item.baseRate}
208+
maxRate={item.maxRate}
209+
/>
210+
))
211+
) : (
212+
<p>검색된 적금 상품이 없습니다.</p>
213+
)}
214+
</div>
215+
)}
214216
</main>
215217
</>
216-
)};
218+
);
219+
};
217220

218221
export default SavingSearchPage;

0 commit comments

Comments
 (0)