diff --git a/index.html b/index.html index 4a5058af..2b7ea3a2 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - +
@@ -8,7 +8,7 @@ href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" /> -이미지 등록
+ +{errorMessage}
} + > + ); +}; + +export default FormImageUpload; diff --git a/src/components/FormImageUpload/formImageUpload.styles.js b/src/components/FormImageUpload/formImageUpload.styles.js new file mode 100644 index 00000000..5a8aaf4e --- /dev/null +++ b/src/components/FormImageUpload/formImageUpload.styles.js @@ -0,0 +1,66 @@ +import { css } from "@emotion/react"; +import mq from "../../styles/media"; +import { closeButtonStyle } from '../../styles/common'; + +export const imageContainerStyle = css` + display: flex; + gap: 2.4rem; +`; + +export const formImageBoxStyle = css` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 12px; + width: 16.8rem; + height: 16.8rem; + background-color: #F3F4F6; + + p { + font-size: 1.6rem; + font-weight: 400; + color: #9CA3AF; + } + + img { + width: 4.8rem; + height: 4.8rem; + } + + ${mq({ + width: ['16.8rem', '16.8rem', '28.2rem', '28.2rem'], + height: ['16.8rem', '16.8rem', '28.2rem', '28.2rem'], + })} +`; + +export const itemPreviewContainerStyle = css` + position: relative; +`; + +export const previewImageStyle = css` + width: 16.8rem; + height: 16.8rem; + object-fit: cover; + object-position: center; + + ${mq({ + width: ['16.8rem', '16.8rem', '28.2rem', '28.2rem'], + height: ['16.8rem', '16.8rem', '28.2rem', '28.2rem'], + })} +`; + +export const imageCloseButtonStyle = css` + ${closeButtonStyle}; + position: absolute; + top: 3%; + right: 3%; + width: 2.4rem; + height: 2.4rem; +`; + +export const errorMessageStyle = css` + color: red; + font-size: 1.6rem; + margin-top: 1.6rem; +`; \ No newline at end of file diff --git a/src/components/FormInputs/FormInputs.jsx b/src/components/FormInputs/FormInputs.jsx new file mode 100644 index 00000000..d3244e22 --- /dev/null +++ b/src/components/FormInputs/FormInputs.jsx @@ -0,0 +1,34 @@ +import * as S from './formInputs.styles'; + +const FormInputs = ({ name, onNameChange, description, onDescriptionChange, price, onPriceChange }) => { + return ( + <> + + onNameChange(e.target.value)} + /> + + +