Skip to content

Commit

Permalink
Merge pull request #73 from Amattang/fix/#52-mapbug
Browse files Browse the repository at this point in the history
fix/#52-mapbug
  • Loading branch information
SJLEE316 authored Apr 1, 2022
2 parents 17a5b07 + 47b0aa6 commit d9c1118
Show file tree
Hide file tree
Showing 10 changed files with 381 additions and 188 deletions.
Binary file added assets/images/map/mapClose2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion components/CheckListComponent/ButtonsOfTypeM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import styles from '../../screens/Landing/styles';
import { requestPermission } from '../../utils/LocationPermission';
import Geolocation from 'react-native-geolocation-service';
import { OnBoardingStackProps } from '../../types/navigationTypes';
import { useNavigation } from '@react-navigation/native';

const ButtonsOfTypeM = ({ navigation }: OnBoardingStackProps) => {
const ButtonsOfTypeM = () => {
// 현재위치 찾기
const navigation = useNavigation();

const goGeoLocation = (): void => {
Geolocation.getCurrentPosition(
(position) => {
Expand Down
7 changes: 3 additions & 4 deletions components/CheckListComponent/CheckListComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ function CheckListComponent({
) : null}
{checkList.type === 'M' ? (
<ButtonsOfTypeM
isEdit={isEdit}
checkList={checkList}
setCheckLists={setCheckLists}
checkLists={checkLists}
// checkList={checkList}
// setCheckLists={setCheckLists}
// checkLists={checkLists}
/>
) : null}
</View>
Expand Down
14 changes: 11 additions & 3 deletions components/Map/AddressItem.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import React, { useState } from 'react';
import { useNavigation } from '@react-navigation/native';
import React, { Dispatch, SetStateAction, useState } from 'react';
import { Pressable, TextInput, View } from 'react-native';
import { DefaultText } from '../../CustomText';
import { styles } from './AddressItem.style';

type Props = {
address: string | undefined;
// setFullAddress : Dispatch<SetStateAction<string>>;
};

const AddressItem = ({ address }: Props) => {
const AddressItem = ({ address}: Props) => {

const navigation = useNavigation();

const [specificAddress, onChangeText] = useState<string>('');

return (
Expand All @@ -20,7 +25,10 @@ const AddressItem = ({ address }: Props) => {
style={styles.detailAddress}
/>
<Pressable
onPress={() => console.log('주소 등록')}
onPress={() => {
// setFullAddress(`${address} ${specificAddress}`)
navigation.goBack()
}}
style={[styles.addressBtn, styles.bottomBtn]}
>
<DefaultText style={styles.settingText}>이 위치로 주소 설정</DefaultText>
Expand Down
4 changes: 2 additions & 2 deletions components/Map/GoNowPosition.style.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { StyleSheet } from 'react-native';

export const styles = StyleSheet.create({
floatingBtn: {
floatingBtnWrapper: {
justifyContent: 'center',
alignItems: 'center',
borderRadius: 55,
position: 'absolute',
right: 20,
bottom: 24,
bottom:234,
},
});
4 changes: 2 additions & 2 deletions components/Map/GoNowPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ const GoNowPosition = ({ setLocation, coordToAddress }: Props) => {

return (
<>
<Pressable onPress={goGeoLocation}>
<Pressable onPress={goGeoLocation} style={styles.floatingBtnWrapper}>
<Image
source={require('../../assets/images/map/myPosition.png')}
style={styles.floatingBtn}
// style={styles.floatingBtn}
/>
</Pressable>
</>
Expand Down
10 changes: 8 additions & 2 deletions components/Map/Modal.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ export const styles = StyleSheet.create({
height: 102,
},
close: {
// position: 'absolute',
// left: 27.58,
// top: 56.58,
// zIndex:1,
justifyContent: 'center',
alignItems: 'center',
position: 'absolute',
left: 27.58,
top: 56.58,
left: 26.58,
top:56.58,
},
title: {
fontSize: 17,
Expand Down
12 changes: 7 additions & 5 deletions components/Map/ModalAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Image, Modal, Pressable, Text, View } from 'react-native';
import { Alert, Image, Modal, Pressable, Text, View } from 'react-native';
import Postcode from '@actbase/react-daum-postcode';
import { DefaultText } from '../../CustomText';
import { useNavigation } from '@react-navigation/native';
Expand All @@ -11,13 +11,15 @@ const ModalAddress = () => {

// @brief 주소검색창 - 데이터 조회
const [isModal, setModal] = useState<boolean>(false);
// const [fullAddress, setFullAddress] = useState<string>("");

return (
<>
<Modal visible={isModal}>
<View style={styles.header}>
<Pressable onPress={() => setModal(false)}>
<Image style={styles.close} source={require('../../assets/images/map/mapClose.png')} />
<Pressable style={styles.close} onPress={() => {
setModal(false)}}>
<Image source={require('../../assets/images/map/mapClose.png')} />
</Pressable>
<DefaultText style={styles.title}>주소 설정</DefaultText>
</View>
Expand All @@ -29,15 +31,15 @@ const ModalAddress = () => {
}}
onSelected={(data) => {
setModal(false);
navigation.navigate('map', { activeType: false, address: data.address });
navigation.navigate('map', { activeType: false, address: data.address});
}}
/>
</Modal>
<Pressable
onPress={() => setModal(true)}
style={[styles.directInputOfAddress, styles.buttonOfCheckList]}
>
<DefaultText style={styles.directInputTextOfAddress}>직접 입력</DefaultText>
<DefaultText style={styles.directInputTextOfAddress}>직접입력</DefaultText>
</Pressable>
</>
);
Expand Down
Loading

0 comments on commit d9c1118

Please sign in to comment.