From fef9f276740287bdec7ad90cd4aa9169c62b9595 Mon Sep 17 00:00:00 2001 From: Dayoung Park Date: Thu, 12 Jan 2023 20:09:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20edit=20button=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=97=86=EC=9D=84=20=EB=95=8C=20=EB=B9=84=ED=99=9C=EC=84=B1?= =?UTF-8?q?=ED=99=94=20=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=ED=96=88=EC=8A=B5=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/screen/EditPage.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/screen/EditPage.jsx b/src/screen/EditPage.jsx index 97cda2b..69c1500 100644 --- a/src/screen/EditPage.jsx +++ b/src/screen/EditPage.jsx @@ -29,6 +29,9 @@ const EditPage = ({ navigation: { navigate }, route: { params } }) => { const eachTimeObject = strToObjTime(eachTime); const [editTime, setEditTime] = useState(eachTimeObject); + // flag. 수정여부를 알려주는 state + const [edited, setEdited] = useState(false); + // time, editTime 옵션 적용된 문자열 시간값으로 전환 const localTime = translateTime(time); const localEditTime = translateTime(editTime); @@ -67,11 +70,6 @@ const EditPage = ({ navigation: { navigate }, route: { params } }) => { }; // 타임피커 로직 - - // 시간 표시 옵션 - const options = { hour: 'numeric', minute: '2-digit' }; - // const [editTime, setEditTime] = useState(eachTime); - // console.log('time', time); const [isOpenModal, setIsOpenModal] = useState(false); const handleOpenModal = () => { @@ -84,6 +82,7 @@ const EditPage = ({ navigation: { navigate }, route: { params } }) => { const onChangeEditTime = (event, selectedTime) => { setEditTime(selectedTime); + setEdited(true); }; return ( @@ -117,7 +116,7 @@ const EditPage = ({ navigation: { navigate }, route: { params } }) => { {isEdit ? ( ) : (