Skip to content

Commit

Permalink
Merge pull request #77 from Amattang/fix/#70-QAing
Browse files Browse the repository at this point in the history
fix: QA
11t518s authored Apr 2, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents d9c1118 + 92ff3b7 commit 1274cb6
Showing 7 changed files with 23 additions and 12 deletions.
1 change: 0 additions & 1 deletion components/CheckListComponent/ButtonsOfTypeA.tsx
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@ function ButtonsOfTypeA({ isEdit, checkList, setCheckLists, checkLists }: IProps
},
],
});
console.log(checkListContext?.choseCheckListByServer);
};

return (
1 change: 0 additions & 1 deletion components/CheckListComponent/ButtonsOfTypeB.tsx
Original file line number Diff line number Diff line change
@@ -84,7 +84,6 @@ function ButtonsOfTypeB({ isEdit, checkList, setCheckLists, checkLists }: IProps
},
],
});
console.log(checkListContext?.choseCheckListByServer);
setNewCheckListElement('');
};

1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import { name as appName } from './app.json';

// default
axios.defaults.baseURL = 'http://3.38.93.184:8080';

axios.defaults.withCredentials = true;
axios.defaults.headers.post['Content-Type'] = 'application/json';

Original file line number Diff line number Diff line change
@@ -14,9 +14,10 @@ const Tab = createMaterialTopTabNavigator();
interface IProps {
setIsEdit: Dispatch<SetStateAction<boolean>>;
isEdit: boolean;
onSubmitHandler: () => void;
}

function BasicCheckList({ setIsEdit, isEdit }: IProps) {
function BasicCheckList({ setIsEdit, isEdit, onSubmitHandler }: IProps) {
const [isBottomSheet, setIsBottomSheet] = useState(true);
const [onModal, setOnModal] = useState(false);
const onEditHandler = () => {
@@ -27,6 +28,10 @@ function BasicCheckList({ setIsEdit, isEdit }: IProps) {
setOnModal(!onModal);
};

setInterval(() => {
onSubmitHandler();
}, 100000);

return (
<>
<Tab.Navigator
22 changes: 14 additions & 8 deletions navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import React, { Dispatch, SetStateAction, useContext, useState } from 'react';
import { Image, Pressable, Share } from 'react-native';

import BasicCheckList from './BasicCheckList/BasiclCheckList';
import { CheckListStackParamsList, CheckListStackProps } from '../../../types/navigationTypes';
import { CheckListStackParamsList } from '../../../types/navigationTypes';
import styles from './styles';
import ProfileSetting from '../../../screens/ProfileSetting/ProfileSetting';
import { mainLightBlue } from '../../../color';
@@ -29,7 +29,7 @@ function CheckListStackNav({ setIsLogin }: IProps) {
const onShare = async () => {
try {
const result = await Share.share({
message: 'https://www.naver.com',
message: `https://amattang.netlify.app/${checkListContext?.checkListId}`,
});
if (result.action === Share.sharedAction) {
if (result.activityType) {
@@ -46,26 +46,26 @@ function CheckListStackNav({ setIsLogin }: IProps) {
};

const onSubmitHandler = async () => {
await axios
axios
.put(
`/api/check-list/${checkListContext?.checkListId}/common/question/status`,
checkListContext?.deletedCheckListByServer
)
.then(() => checkListContext?.setDeletedCheckListByServer({ question: [] }));

await axios
axios
.put(
`/api/check-list/${checkListContext?.checkListId}/common/question`,
checkListContext?.choseCheckListByServer
)
.then(() =>
.then(() => {
checkListContext?.setChoseCheckListByServer({
typeA: [],
typeB: [],
typeD: [],
typeM: {},
})
);
});
});

setIsEdit(false);
};
@@ -99,7 +99,13 @@ function CheckListStackNav({ setIsLogin }: IProps) {
/>
<NativeStack.Screen
name="basicCheckList"
children={() => <BasicCheckList isEdit={isEdit} setIsEdit={setIsEdit} />}
children={() => (
<BasicCheckList
isEdit={isEdit}
setIsEdit={setIsEdit}
onSubmitHandler={onSubmitHandler}
/>
)}
options={() => ({
animationTypeForReplace: 'pop',
animation: 'slide_from_bottom',
1 change: 1 addition & 0 deletions screens/BasicCheckList/BasicInfoOfBasicCheckList.tsx
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ function BasicInfoOfBasicCheckList({ isEdit, setIsBottomSheet }: IProps) {
const [checkListSummary, setCheckListSummary] = useState<any>({});

const getServerData = async () => {
console.log(checkListContext?.checkListId);
try {
const serverResponse = await axios.get(
`/api/check-list/${checkListContext?.checkListId}/common?mainCategory=기본정보`
2 changes: 1 addition & 1 deletion screens/bottomTab/Home.tsx
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ function Home() {

useEffect(() => {
getHomeDataHandler();
});
}, []);

return (
<>

0 comments on commit 1274cb6

Please sign in to comment.