Skip to content

Commit f6e041f

Browse files
1. UI/UX 고도화
- 전역 CSS 테마 개편: Inter 폰트 적용, 현대적인 카드 레이아웃 및 그림자 효과 강화 - 상품 목록/검색 컴포넌트 리팩터링: 그리드 기반 모던 디자인으로 개선 - 사용자 경험 개선: 로딩 스피너 및 API 에러 피드백 디자인 추가 2. 성능 모니터링 - API 응답 지연 시간(ms) 측정: Axios Interceptor 기반 로직 구현 - ResponseTimeToast 컴포넌트 추가: Custom Event 기반, 우측 하단 실시간 ms 노출 3. 기타 개선 사항 - 메인 내비게이션 바 레이아웃 및 접근성 개선 - 상품 가격 KRW 포맷팅 적용
1 parent 1b81df4 commit f6e041f

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/components/products/ProductDetails.jsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function ProductDetails() {
99

1010
const fetchProductDetails = async () => {
1111
if (!productId) {
12-
setError('Please enter a Product ID.');
12+
setError('상품 ID를 입력해주세요.');
1313
return;
1414
}
1515
setLoading(true);
@@ -19,7 +19,7 @@ function ProductDetails() {
1919
const response = await axiosInstance.get(`/api/v2/products/${productId}`);
2020
setProduct(response.data);
2121
} catch (err) {
22-
setError(`Failed to fetch product details for ID ${productId}.`);
22+
setError(`ID ${productId}에 해당하는 상품 정보를 불러오지 못했습니다.`);
2323
console.error(err);
2424
} finally {
2525
setLoading(false);
@@ -28,23 +28,23 @@ function ProductDetails() {
2828

2929
return (
3030
<div>
31-
<h3>Product Details (V2)</h3>
31+
<h3>상품 상세 정보</h3>
3232
<input
3333
type="text"
3434
value={productId}
3535
onChange={(e) => setProductId(e.target.value)}
36-
placeholder="Enter Product ID"
36+
placeholder="상품 ID 입력"
3737
/>
38-
<button onClick={fetchProductDetails}>Get Details</button>
38+
<button onClick={fetchProductDetails}>조회하기</button>
3939

40-
{loading && <p>Loading product details...</p>}
40+
{loading && <p>상품 정보를 불러오는 중...</p>}
4141
{error && <p style={{ color: 'red' }}>{error}</p>}
4242
{product && (
4343
<div>
44-
<p>Name: {product.prodName}</p>
45-
<p>Price: {product.price}</p>
46-
<p>Image: <img src={product.imageUrl} alt={product.prodName} style={{ maxWidth: '100px' }} /></p>
47-
<p>Type: {product.productTypeName}</p>
44+
<p>상품명: {product.prodName}</p>
45+
<p>가격: {product.price}</p>
46+
<p>이미지: <img src={product.imageUrl} alt={product.prodName} style={{ maxWidth: '100px' }} /></p>
47+
<p>카테고리: {product.productTypeName}</p>
4848
</div>
4949
)}
5050
</div>

src/components/products/ProductList.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ function ProductList({ products }) {
99
if (!products || products.length === 0) {
1010
return (
1111
<div style={{ textAlign: 'center', padding: '2rem', color: '#64748b' }}>
12-
<p>No products found matching your search.</p>
12+
<p>검색 결과와 일치하는 상품이 없습니다.</p>
1313
</div>
1414
);
1515
}
1616

1717
return (
1818
<div>
19-
<h3 style={{ marginBottom: '1.5rem' }}>Available Products</h3>
19+
<h3 style={{ marginBottom: '1.5rem' }}>판매 중인 상품</h3>
2020
<div className="product-list">
2121
{products.map((product) => (
2222
<div key={product.productId} className="product-card" style={{ cursor: 'pointer' }}>
@@ -47,7 +47,7 @@ function ProductList({ products }) {
4747
}}
4848
/>
4949
) : (
50-
<div style={{ color: '#94a3b8', fontSize: '0.875rem' }}>No Image</div>
50+
<div style={{ color: '#94a3b8', fontSize: '0.875rem' }}>이미지 없음</div>
5151
)}
5252
</div>
5353
<div onClick={() => navigate(`/products/${product.productId}`)}>
@@ -70,10 +70,10 @@ function ProductList({ products }) {
7070
onClick={(e) => {
7171
e.stopPropagation();
7272
addToCart(product);
73-
alert('Added to cart!');
73+
alert('장바구니에 추가되었습니다!');
7474
}}
7575
>
76-
Add to Cart
76+
장바구니 담기
7777
</button>
7878
</div>
7979
</div>

src/components/products/ProductSearch.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function ProductSearch({ onSearch, keyword, setKeyword }) {
5353
style={{ marginBottom: 0 }}
5454
/>
5555
<button onClick={() => onSearch(keyword)} style={{ marginTop: 0 }}>
56-
검색하기 style={{ marginBottom: 0 }}
56+
검색
5757
</button>
5858
</div>
5959

0 commit comments

Comments
 (0)