From a9c26916e2b83813af3cf0b1873ec1398313c214 Mon Sep 17 00:00:00 2001 From: 11t518s <11t518s20161759@gmail.com> Date: Thu, 31 Mar 2022 21:46:45 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20QA=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=83=89=EC=83=81,=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EC=8B=9C=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EC=98=AC=EB=A6=AC=EB=8A=94=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20#70?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckListComponent/ButtonsOfTypeB.tsx | 1 + .../CheckListComponent/ButtonsOfTypeD.tsx | 1 + .../myItem/MyItemOfBottomSheets.tsx | 2 + .../StackNavigationOfCheckList.tsx | 25 ++++++---- screens/BasicCheckList/Inside/Bathroom.tsx | 46 ++++++++++--------- screens/BasicCheckList/Inside/Ceiling.tsx | 46 ++++++++++--------- screens/BasicCheckList/Inside/Entrance.tsx | 46 ++++++++++--------- screens/BasicCheckList/Inside/Kitchen.tsx | 46 ++++++++++--------- screens/BasicCheckList/Inside/Option.tsx | 46 ++++++++++--------- screens/BasicCheckList/Inside/Wall.tsx | 46 ++++++++++--------- screens/BasicCheckList/Inside/Window.tsx | 45 +++++++++--------- .../OutsideOfBasicCheckList.tsx | 45 +++++++++--------- 12 files changed, 217 insertions(+), 178 deletions(-) diff --git a/components/CheckListComponent/ButtonsOfTypeB.tsx b/components/CheckListComponent/ButtonsOfTypeB.tsx index f335dff..79afbac 100644 --- a/components/CheckListComponent/ButtonsOfTypeB.tsx +++ b/components/CheckListComponent/ButtonsOfTypeB.tsx @@ -98,6 +98,7 @@ function ButtonsOfTypeB({ isEdit, checkList, setCheckLists, checkLists }: IProps onChangeText={onChangeText} onEndEditing={() => onEndEditing(answer)} placeholder={answer.type ? answer.type : '직접 입력'} + placeholderTextColor={'#D6D4D4'} style={[styles.typeDBtnWrapper]} /> diff --git a/components/CheckListComponent/ButtonsOfTypeD.tsx b/components/CheckListComponent/ButtonsOfTypeD.tsx index 2043245..dbe36d6 100644 --- a/components/CheckListComponent/ButtonsOfTypeD.tsx +++ b/components/CheckListComponent/ButtonsOfTypeD.tsx @@ -157,6 +157,7 @@ function ButtonsOfTypeD({ isEdit, checkList, setCheckLists, checkLists }: IProps onChangeText={onChangeTextHandler} onEndEditing={onEndEditing} placeholder={'+ 직접 입력'} + placeholderTextColor={'#D6D4D4'} value={newCheckListElement} style={[styles.typeDBtnWrapper, styles.typeDInputBtnWrapper]} /> diff --git a/components/CheckListComponent/myItem/MyItemOfBottomSheets.tsx b/components/CheckListComponent/myItem/MyItemOfBottomSheets.tsx index 26fa8a1..466316c 100644 --- a/components/CheckListComponent/myItem/MyItemOfBottomSheets.tsx +++ b/components/CheckListComponent/myItem/MyItemOfBottomSheets.tsx @@ -81,6 +81,7 @@ function MyItemOfBottomSheets({ onCategoryNameHandler(newCategoryName)} @@ -98,6 +99,7 @@ function MyItemOfBottomSheets({ onCreateQuestionElementTextHandler(elementText)} diff --git a/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx b/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx index 3cc6368..5637aff 100644 --- a/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx +++ b/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx @@ -46,22 +46,27 @@ function CheckListStackNav({ setIsLogin }: IProps) { }; const onSubmitHandler = async () => { - console.log(checkListContext?.choseCheckListByServer); - try { - await axios.put( + await axios + .put( `/api/check-list/${checkListContext?.checkListId}/common/question/status`, checkListContext?.deletedCheckListByServer - ); - await axios.put( + ) + .then(() => checkListContext?.setDeletedCheckListByServer({ question: [] })); + + await axios + .put( `/api/check-list/${checkListContext?.checkListId}/common/question`, checkListContext?.choseCheckListByServer + ) + .then(() => + checkListContext?.setChoseCheckListByServer({ + typeA: [], + typeB: [], + typeD: [], + typeM: {}, + }) ); - } catch (error) { - console.error(error); - } - checkListContext?.setDeletedCheckListByServer({ question: [] }); - checkListContext?.setChoseCheckListByServer({ typeA: [], typeB: [], typeD: [], typeM: {} }); setIsEdit(false); }; diff --git a/screens/BasicCheckList/Inside/Bathroom.tsx b/screens/BasicCheckList/Inside/Bathroom.tsx index 19aef4f..2bcf8fc 100644 --- a/screens/BasicCheckList/Inside/Bathroom.tsx +++ b/screens/BasicCheckList/Inside/Bathroom.tsx @@ -25,6 +25,7 @@ import ButtonOfBringBackDeletedCheckList from '../../../components/CheckListComp import BottomSheetsOfDeletedCheckList from '../../../components/CheckListComponent/BottomSheetsOfDeletedCheckList'; import { GetCheckListServerData } from '../../../api/GetCheckListServerData'; import { checkListCtx } from '../../../Context/CheckListByServer'; +import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; interface IProps { isEdit: boolean; @@ -76,29 +77,32 @@ function Bathroom({ isEdit, setIsBottomSheet }: IProps) { <> {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + + {onServerData ? ( - - {checkLists - .filter((item) => item.visibility) - .map((mainQuestionItem: checkListTypes) => ( - + + {checkLists + .filter((item) => item.visibility) + .map((mainQuestionItem: checkListTypes) => ( + + ))} + + {deletedCheckLists.length !== 0 && ( + - ))} - - {deletedCheckLists.length !== 0 && ( - - )} - + )} + +