diff --git a/src/pages/WriteSteps/PhotoStep.jsx b/src/pages/WriteSteps/PhotoStep.jsx index 59fab8b..ed773e0 100644 --- a/src/pages/WriteSteps/PhotoStep.jsx +++ b/src/pages/WriteSteps/PhotoStep.jsx @@ -1,27 +1,29 @@ import Button from '../../components/Button'; import ButtonArea from '../../components/ButtonArea'; +import ImageInput from '../../components/ImageInput'; import ImageViewer from '../../components/ImageViewer'; +import Spacer from '../../components/Spacer'; import * as S from '../../styles/WriteSteps.styles'; function PhotoStep({ gotoNextStep, gotoPrevStep, photos, setPhotos }) { + const handleChange = ({ target }) => { + const { files } = target; + const newPhotos = [...photos]; + Array.from(files).forEach((file) => + newPhotos.push(URL.createObjectURL(file)) + ); + setPhotos(newPhotos); + }; return ( 휴대폰 사진을 올려주세요 - 사진 - {/* TODO: upload photo */} - { - const file = e.target.files[0]; - const reader = new FileReader(); - reader.onload = () => { - setPhotos([...photos, reader.result]); - }; - reader.readAsDataURL(file); - }} + - {photos && } + + {photos.length > 0 && }