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 && ( - - )} - + )} + +