@@ -18,7 +18,7 @@ function ProductDetailPage() {
1818 const response = await axiosInstance . get ( `/api/v2/products/${ productId } ` ) ;
1919 setProduct ( response . data ) ;
2020 } catch ( err ) {
21- setError ( 'Failed to fetch product details .' ) ;
21+ setError ( '상품 정보를 불러오는 데 실패했습니다 .' ) ;
2222 console . error ( err ) ;
2323 } finally {
2424 setLoading ( false ) ;
@@ -27,26 +27,27 @@ function ProductDetailPage() {
2727 fetchProduct ( ) ;
2828 } , [ productId ] ) ;
2929
30- if ( loading ) return < div style = { { textAlign : 'center' , padding : '5rem' } } > Loading product ...</ div > ;
31- if ( error ) return < div style = { { color : 'red ' , textAlign : 'center' , padding : '5rem' } } > { error } </ div > ;
30+ if ( loading ) return < div style = { { textAlign : 'center' , padding : '5rem' , color : 'var(--text-muted)' } } > 상품 정보를 불러오는 중 ...</ div > ;
31+ if ( error ) return < div style = { { color : 'var(--error-color) ' , textAlign : 'center' , padding : '5rem' } } > { error } </ div > ;
3232 if ( ! product ) return null ;
3333
3434 return (
3535 < div className = "container" >
3636 < div className = "card" style = { { padding : '2rem' } } >
3737 < button
3838 onClick = { ( ) => navigate ( - 1 ) }
39- style = { { background : 'transparent' , color : 'var(--text-muted)' , padding : 0 , marginBottom : '1rem' } }
39+ style = { { background : 'transparent' , color : 'var(--text-muted)' , padding : 0 , marginBottom : '1rem' , border : 'none' , cursor : 'pointer' , fontSize : '1rem' } }
4040 >
41- ← Back to list
41+ ← 목록으로 돌아가기
4242 </ button >
4343
4444 < div style = { { display : 'grid' , gridTemplateColumns : '1fr 1fr' , gap : '2rem' } } >
45- < div style = { { background : '#f1f5f9' , borderRadius : '12px' , overflow : 'hidden' } } >
45+ < div style = { { background : '#f1f5f9' , borderRadius : '12px' , overflow : 'hidden' , display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } >
4646 < img
4747 src = { product . imageUrl || 'https://via.placeholder.com/400x400?text=No+Image' }
4848 alt = { product . prodName }
49- style = { { width : '100%' , height : 'auto' , display : 'block' } }
49+ style = { { width : '100%' , height : 'auto' , display : 'block' , objectFit : 'contain' } }
50+ onError = { ( e ) => { e . target . src = 'https://via.placeholder.com/400x400?text=No+Image' ; } }
5051 />
5152 </ div >
5253
@@ -59,31 +60,31 @@ function ProductDetailPage() {
5960 fontSize : '0.75rem' ,
6061 fontWeight : 'bold'
6162 } } >
62- { product . productTypeName }
63+ { product . productTypeName || '상품' }
6364 </ span >
64- < h1 style = { { margin : '0.5rem 0' } } > { product . prodName } </ h1 >
65- < div className = "product-price" style = { { fontSize : '2rem ' , marginBottom : '1.5rem' } } >
65+ < h1 style = { { margin : '0.5rem 0' , fontSize : '2rem' } } > { product . prodName } </ h1 >
66+ < div className = "product-price" style = { { fontSize : '2.5rem ' , marginBottom : '1.5rem' , fontWeight : 800 } } >
6667 ₩{ product . price ?. toLocaleString ( ) }
6768 </ div >
6869
6970 < div style = { { borderTop : '1px solid var(--border-color)' , paddingTop : '1.5rem' , marginBottom : '2rem' } } >
70- < h3 style = { { fontSize : '1.1rem' , marginBottom : '0.5rem' } } > Product Information </ h3 >
71- < p style = { { color : 'var(--text-muted)' } } >
72- Section: { product . sectionName } < br / >
73- Department: { product . departmentName } < br / >
74- Group: { product . indexGroupName } < br / >
75- Colour: { product . colourGroupName }
76- </ p >
71+ < h3 style = { { fontSize : '1.1rem' , marginBottom : '1rem' , color : 'var(--text-main)' } } > 상품 상세 정보 </ h3 >
72+ < div style = { { display : 'flex' , flexDirection : 'column' , gap : '0.6rem' , color : 'var(--text-muted)' , fontSize : '0.95rem ' } } >
73+ < div style = { { display : 'flex' } } > < span style = { { width : '100px' , fontWeight : 600 } } > 섹션 </ span > < span > { product . sectionName } </ span > </ div >
74+ < div style = { { display : 'flex' } } > < span style = { { width : '100px' , fontWeight : 600 } } > 부서 </ span > < span > { product . departmentName } </ span > </ div >
75+ < div style = { { display : 'flex' } } > < span style = { { width : '100px' , fontWeight : 600 } } > 그룹 </ span > < span > { product . indexGroupName } </ span > </ div >
76+ < div style = { { display : 'flex' } } > < span style = { { width : '100px' , fontWeight : 600 } } > 색상 </ span > < span > { product . colourGroupName } </ span > </ div >
77+ </ div >
7778 </ div >
7879
7980 < button
80- style = { { width : '100%' , padding : '1rem ' , fontSize : '1.1rem ' } }
81+ style = { { width : '100%' , padding : '1.2rem ' , fontSize : '1.2rem' , fontWeight : 'bold ' } }
8182 onClick = { ( ) => {
8283 addToCart ( product ) ;
83- alert ( 'Added to cart !' ) ;
84+ alert ( '장바구니에 추가되었습니다 !' ) ;
8485 } }
8586 >
86- Add to Shopping Cart
87+ 장바구니에 담기
8788 </ button >
8889 </ div >
8990 </ div >
0 commit comments