From 0af9d9da40e468d98e8b183d6c7ed1bd452d8abe Mon Sep 17 00:00:00 2001 From: sinyroom Date: Fri, 27 Jun 2025 22:20:19 +0900 Subject: [PATCH 01/18] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EC=97=85=EB=A1=9C=EB=93=9C=20=EA=B4=80=EB=A0=A8=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UI/ImageUpload.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/UI/ImageUpload.jsx b/src/components/UI/ImageUpload.jsx index dd1fb785..55b44192 100644 --- a/src/components/UI/ImageUpload.jsx +++ b/src/components/UI/ImageUpload.jsx @@ -15,20 +15,21 @@ function ImageUpload() { const file = e.target.files?.[0]; if (!file) return; - const preview = URL.createObjectURL(file); - setPreviewUrl(preview); + if (file) { + const preview = URL.createObjectURL(file); + setPreviewUrl(preview); - if (previewUrl) { - setError('*이미지 등록은 최대 1개까지 가능합니다.'); + if (previewUrl) { + setError('*이미지 등록은 최대 1개까지 가능합니다.'); + } e.target.value = ''; return; } - - setError(''); }; const handleImageRemove = () => { setPreviewUrl(null); + setError(''); }; useEffect(() => { From 1bf6c81b6beac1c404443730d86a610b1a7d9089 Mon Sep 17 00:00:00 2001 From: sinyroom Date: Fri, 27 Jun 2025 22:36:19 +0900 Subject: [PATCH 02/18] =?UTF-8?q?refactor:=20=ED=97=B7=EA=B0=88=EB=A6=AC?= =?UTF-8?q?=EB=8A=94=20=EB=B3=80=EC=88=98=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pages/AddItemPage/AddItemPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/pages/AddItemPage/AddItemPage.jsx b/src/components/pages/AddItemPage/AddItemPage.jsx index 98cf9e96..1e514910 100644 --- a/src/components/pages/AddItemPage/AddItemPage.jsx +++ b/src/components/pages/AddItemPage/AddItemPage.jsx @@ -13,7 +13,7 @@ function AddItemPage() { const [price, handlePriceChange] = useFormatNumber(''); const [tags, setTags] = useState([]); - const isDisabled = name.trim() && description.trim() && price.trim() && tags.length > 0; + const isValid = name.trim() && description.trim() && price.trim() && tags.length > 0; return ( @@ -21,7 +21,7 @@ function AddItemPage() {

상품 등록하기

등록 From 94aa7d5f8de27c4c4a73397df556dcdf96518629 Mon Sep 17 00:00:00 2001 From: sinyroom Date: Fri, 27 Jun 2025 23:01:38 +0900 Subject: [PATCH 03/18] =?UTF-8?q?style:=20styled-component=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/Header.jsx | 44 +++++++------- src/components/UI/ImageUpload.jsx | 46 +++++++-------- src/components/UI/InputField.jsx | 10 ++-- src/components/UI/SearchBar.jsx | 22 +++---- src/components/UI/Taginput.jsx | 24 ++++---- .../pages/AddItemPage/AddItemPage.jsx | 24 ++++---- .../pages/MarketPage/AddItemButton.jsx | 6 +- .../pages/MarketPage/AllProducts.jsx | 58 +++++++++---------- .../pages/MarketPage/BestProducts.jsx | 12 ++-- src/components/pages/MarketPage/ItemCard.jsx | 32 +++++----- .../pages/MarketPage/MarketPage.jsx | 6 +- 11 files changed, 142 insertions(+), 142 deletions(-) diff --git a/src/components/Layout/Header.jsx b/src/components/Layout/Header.jsx index 97abc131..802444bc 100644 --- a/src/components/Layout/Header.jsx +++ b/src/components/Layout/Header.jsx @@ -12,38 +12,38 @@ function Header() { const isMarketActive = location.pathname === '/items' || location.pathname === '/additem'; return ( - - + + - - - + 로그인 - + ); } export default Header; -const HeaderContainer = styled.header` +const StyledHeaderContainer = styled.header` display: flex; justify-content: space-between; align-items: center; @@ -74,20 +74,20 @@ const HeaderContainer = styled.header` } `; -const HeaderLeft = styled.div` +const StyledHeaderLeft = styled.div` display: flex; align-items: center; gap: 10px; `; -const Ul = styled.ul` +const StyledUl = styled.ul` display: flex; align-items: center; gap: 8px; margin-top: 4px; `; -const Li = styled.li` +const StyledLi = styled.li` ${applyFontStyles(FontTypes.BOLD16, ColorTypes.SECONDARY_GRAY_600)}; &:hover { @@ -95,7 +95,7 @@ const Li = styled.li` } `; -const StNavLink = styled(NavLink)` +const StyledNavLink = styled(NavLink)` color: ${({ $isActive, theme }) => $isActive ? theme.colors[ColorTypes.PRIMARY_100] : theme.colors[ColorTypes.SECONDARY_GRAY_600]}; @@ -104,7 +104,7 @@ const StNavLink = styled(NavLink)` } `; -const TextLogo = styled.img` +const StyledTextLogo = styled.img` width: 81px; display: none; @@ -113,7 +113,7 @@ const TextLogo = styled.img` } `; -const Imglogo = styled.img` +const StyledImglogo = styled.img` width: 153px; display: block; diff --git a/src/components/UI/ImageUpload.jsx b/src/components/UI/ImageUpload.jsx index 55b44192..26c9d349 100644 --- a/src/components/UI/ImageUpload.jsx +++ b/src/components/UI/ImageUpload.jsx @@ -41,19 +41,19 @@ function ImageUpload() { }, [previewUrl]); return ( - + - - + - - + + plus 이미지 등록 - - + + {previewUrl && ( - - + - - + )} - + - {error && {error}} - + {error && {error}} + ); } export default ImageUpload; -const Container = styled.div` +const StyledContainer = styled.div` display: flex; flex-direction: column; gap: 16px; `; -const Wrapper = styled.div` +const StyledWrapper = styled.div` position: relative; display: flex; gap: 24px; `; -const ImageWrapper = styled.div` +const StyledImageWrapper = styled.div` display: flex; `; -const StInput = styled.input` +const StyledInput = styled.input` position: absolute; opacity: 0; width: 0; @@ -112,7 +112,7 @@ const StInput = styled.input` overflow: hidden; `; -const StLabel = styled.label` +const StyledLabel = styled.label` display: flex; align-items: center; justify-content: center; @@ -132,22 +132,22 @@ const StLabel = styled.label` } `; -const PreviewImage = styled.div` +const StyledPreviewImage = styled.div` position: relative; `; -const StImage = styled.img` +const StyledImage = styled.img` width: 168px; height: 168px; border-radius: 12px; `; -const StXIcon = styled.img` +const StyledXIcon = styled.img` position: absolute; top: 14px; right: 13px; `; -const ErrorMessage = styled.span` +const StyledErrorMessage = styled.span` ${applyFontStyles(FontTypes.REGULAR16, ColorTypes.ERROR)} `; diff --git a/src/components/UI/InputField.jsx b/src/components/UI/InputField.jsx index 648eb88e..c8f67584 100644 --- a/src/components/UI/InputField.jsx +++ b/src/components/UI/InputField.jsx @@ -2,7 +2,7 @@ import styled from 'styled-components'; function InputField({ label, type, placeholder, isTextArea, value, onChange }) { return isTextArea ? ( - +