From 4add07c5ad66fab40d7cfab6e27dacb3322c58e0 Mon Sep 17 00:00:00 2001 From: 11t518s <11t518s20161759@gmail.com> Date: Thu, 7 Apr 2022 00:39:23 +0900 Subject: [PATCH] fix: QA --- components/camera/CameraAndGallery.tsx | 41 +++++++++---------- .../BasicCheckList/BasiclCheckList.tsx | 2 + .../StackNavigationOfCheckList.tsx | 10 ++++- .../BasicInfoOfBasicCheckList.tsx | 5 ++- screens/Landing/styles.tsx | 2 +- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/components/camera/CameraAndGallery.tsx b/components/camera/CameraAndGallery.tsx index 490e7fa..82c76ba 100644 --- a/components/camera/CameraAndGallery.tsx +++ b/components/camera/CameraAndGallery.tsx @@ -14,15 +14,17 @@ interface IProps { function CameraAndGallery({ setOnModal, onModal }: IProps) { const checkListContext = useContext(checkListCtx); - const onPostCameraDataHandler = async (image: any) => { - const imageData = new FormData(); - imageData.append('image', { - uri: Platform.OS === 'android' ? image.path : image.path.replace('file://', ''), - type: image.mime, - name: image.filename, - }); + const onPostCameraDataHandler = async (images: any) => { + const imageData = await new FormData(); + await images.map((image: any) => + imageData.append('image', { + uri: Platform.OS === 'android' ? image.path : image.path.replace('file://', ''), + type: image.mime, + name: image.filename, + }) + ); await axios .post(`/api/check-list/${checkListContext?.checkListId}/image`, imageData) .then((e) => { @@ -32,6 +34,13 @@ function CameraAndGallery({ setOnModal, onModal }: IProps) { console.log(e); }); }; + const onCamera = () => + ImagePicker.openCamera({ + cropping: true, + }).then((images: any) => { + onPostCameraDataHandler([images]); + setOnModal(!onModal); + }); const onPostImageDataHandler = async (images: any) => { const imageData = new FormData(); @@ -46,11 +55,9 @@ function CameraAndGallery({ setOnModal, onModal }: IProps) { await axios .post(`/api/check-list/${checkListContext?.checkListId}/image`, imageData) .then((e) => { - console.log('t'); console.log(e); }) .catch((e) => { - console.log('c'); console.log(e); }); }; @@ -63,23 +70,15 @@ function CameraAndGallery({ setOnModal, onModal }: IProps) { setOnModal(!onModal); }); - const onCamera = () => - ImagePicker.openCamera({ - cropping: true, - }).then((image: any) => { - onPostCameraDataHandler(image); - setOnModal(!onModal); - }); - return ( setOnModal(!onModal)}> setOnModal(!onModal)}> - - 카메라 - + {/**/} + {/* 카메라*/} + {/**/} - + {/**/} 앨범 diff --git a/navigation/Main/StackNavigation/BasicCheckList/BasiclCheckList.tsx b/navigation/Main/StackNavigation/BasicCheckList/BasiclCheckList.tsx index 0ea7d43..dc243c2 100644 --- a/navigation/Main/StackNavigation/BasicCheckList/BasiclCheckList.tsx +++ b/navigation/Main/StackNavigation/BasicCheckList/BasiclCheckList.tsx @@ -8,6 +8,8 @@ import MyItemOfBasicCheckList from '../../../../screens/BasicCheckList/MyItemOfB import { mainLightBlue } from '../../../../color'; import FloatingBtn from '../../../../components/CheckListComponent/FloatingBtn'; import CameraAndGallery from '../../../../components/camera/CameraAndGallery'; +import { Dimensions, SafeAreaView } from 'react-native'; +import { useHeaderHeight } from 'react-native-screens/native-stack'; const Tab = createMaterialTopTabNavigator(); diff --git a/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx b/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx index 1e73be5..d39d940 100644 --- a/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx +++ b/navigation/Main/StackNavigation/StackNavigationOfCheckList.tsx @@ -1,5 +1,5 @@ import React, { Dispatch, SetStateAction, useContext, useEffect, useState } from 'react'; -import { Image, Pressable, Share } from 'react-native'; +import { Dimensions, Image, Pressable, SafeAreaView, Share } from 'react-native'; import BasicCheckList from './BasicCheckList/BasiclCheckList'; import { CheckListStackParamsList } from '../../../types/navigationTypes'; @@ -14,6 +14,7 @@ import { import { checkListCtx } from '../../../Context/CheckListByServer'; import { useNavigation } from '@react-navigation/native'; import Map from '../../../screens/bottomTab/Map'; +import { useHeaderHeight } from 'react-native-screens/native-stack'; const NativeStack = createNativeStackNavigator(); @@ -49,6 +50,7 @@ function CheckListStackNav({ setIsLogin }: IProps) { checkListContext?.onChoseCheckListHandler(); setIsEdit(false); }; + const height = Dimensions.get('window').height; const screenOptions: NativeStackNavigationOptions = { animation: 'slide_from_bottom', @@ -85,7 +87,11 @@ function CheckListStackNav({ setIsLogin }: IProps) { /> } + children={() => ( + + + + )} options={() => ({ animationTypeForReplace: 'pop', animation: 'slide_from_bottom', diff --git a/screens/BasicCheckList/BasicInfoOfBasicCheckList.tsx b/screens/BasicCheckList/BasicInfoOfBasicCheckList.tsx index ae5a0a3..f3b8b69 100644 --- a/screens/BasicCheckList/BasicInfoOfBasicCheckList.tsx +++ b/screens/BasicCheckList/BasicInfoOfBasicCheckList.tsx @@ -21,11 +21,12 @@ import BottomSheetsOfDeletedCheckList from '../../components/CheckListComponent/ import { checkListTypes } from '../../types/checkListTypes'; import ButtonOfBringBackDeletedCheckList from '../../components/CheckListComponent/ButtonOfBringBackDeletedCheckList'; import axios from 'axios'; -import { ActivityIndicator, View } from 'react-native'; +import { ActivityIndicator, Dimensions, SafeAreaView, View } from 'react-native'; import { checkListCtx } from '../../Context/CheckListByServer'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import CheckListSummaryComponenet from '../../components/CheckListComponent/CheckListSummaryComponenet'; import { useFocusEffect } from '@react-navigation/native'; +import { useHeaderHeight } from '@react-navigation/elements'; interface IProps { isEdit: boolean; @@ -94,7 +95,7 @@ function BasicInfoOfBasicCheckList({ isEdit, setIsBottomSheet }: IProps) { - + {checkLists .filter((item) => item.visibility) diff --git a/screens/Landing/styles.tsx b/screens/Landing/styles.tsx index 6066d2a..24f01c9 100644 --- a/screens/Landing/styles.tsx +++ b/screens/Landing/styles.tsx @@ -89,7 +89,7 @@ const styles = StyleSheet.create({ borderRadius: 55, position: 'absolute', right: 20, - bottom: 50, + bottom: 70, }, emoji: { lineHeight: 24, fontSize: 12 },