From 4ed04555b5f3799f87fb25b670935fcf989aa206 Mon Sep 17 00:00:00 2001 From: gkqkehs7 <77993709+gkqkehs7@users.noreply.github.com> Date: Sun, 29 Sep 2024 16:39:02 +0900 Subject: [PATCH 1/5] MI-428 add advertiseBanner component --- ios/Podfile.lock | 2 +- ios/modutaxi.xcodeproj/project.pbxproj | 10 +- package-lock.json | 12 + package.json | 1 + src/assets/images/Home/AdvertiseBanner1.svg | 255 +++++++++++++++++++ src/assets/images/Home/AdvertiseBanner2.svg | 41 +++ src/components/Home/AdvertiseBanner.tsx | 57 +++++ src/components/Search/ArrivalSearchBox.tsx | 13 +- src/components/Search/DepartureSearchBox.tsx | 8 +- src/components/Search/SearchBox.tsx | 15 +- src/screens/home/Home.tsx | 4 + yarn.lock | 13 +- 12 files changed, 400 insertions(+), 31 deletions(-) create mode 100644 src/assets/images/Home/AdvertiseBanner1.svg create mode 100644 src/assets/images/Home/AdvertiseBanner2.svg create mode 100644 src/components/Home/AdvertiseBanner.tsx diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cacb8510..b6a3f85f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1603,7 +1603,7 @@ SPEC CHECKSUMS: SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d Sentry: 2f6baed15a3f8056b875fc903dc3dcb2903117f4 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7 + Yoga: 9e6a04eacbd94f97d94577017e9f23b3ab41cf6c PODFILE CHECKSUM: a5154c1a06e55c4e97b95a73eb73a827154c2962 diff --git a/ios/modutaxi.xcodeproj/project.pbxproj b/ios/modutaxi.xcodeproj/project.pbxproj index c3880313..b5e8e061 100644 --- a/ios/modutaxi.xcodeproj/project.pbxproj +++ b/ios/modutaxi.xcodeproj/project.pbxproj @@ -697,7 +697,10 @@ "-DFOLLY_USE_LIBCPP=1", "-DFOLLY_CFG_NO_COROUTINES=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; @@ -777,7 +780,10 @@ "-DFOLLY_USE_LIBCPP=1", "-DFOLLY_CFG_NO_COROUTINES=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/package-lock.json b/package-lock.json index a3861cb7..f138fbed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "react-native-month-year-picker": "^1.9.0", "react-native-permissions": "^4.1.4", "react-native-reanimated": "^3.8.1", + "react-native-reanimated-carousel": "^3.5.1", "react-native-redash": "^18.1.3", "react-native-safe-area-context": "^4.9.0", "react-native-screens": "^3.29.0", @@ -20424,6 +20425,17 @@ "react-native": "*" } }, + "node_modules/react-native-reanimated-carousel": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.5.1.tgz", + "integrity": "sha512-9BBQV6JAYSQm2lV7MFtT4mzapXmW4IZO6s38gfiJL84Jg23ivGB1UykcNQauKgtHyhtW2NuZJzItb1s42lM+hA==", + "peerDependencies": { + "react": ">=16.8.0", + "react-native": ">=0.6.0", + "react-native-gesture-handler": ">=2.0.0", + "react-native-reanimated": ">=3.0.0" + } + }, "node_modules/react-native-redash": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/react-native-redash/-/react-native-redash-18.1.3.tgz", diff --git a/package.json b/package.json index 7db30229..c57f2db1 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "react-native-month-year-picker": "^1.9.0", "react-native-permissions": "^4.1.4", "react-native-reanimated": "^3.8.1", + "react-native-reanimated-carousel": "^3.5.1", "react-native-redash": "^18.1.3", "react-native-safe-area-context": "^4.9.0", "react-native-screens": "^3.29.0", diff --git a/src/assets/images/Home/AdvertiseBanner1.svg b/src/assets/images/Home/AdvertiseBanner1.svg new file mode 100644 index 00000000..21efded7 --- /dev/null +++ b/src/assets/images/Home/AdvertiseBanner1.svg @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/Home/AdvertiseBanner2.svg b/src/assets/images/Home/AdvertiseBanner2.svg new file mode 100644 index 00000000..dc981333 --- /dev/null +++ b/src/assets/images/Home/AdvertiseBanner2.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/Home/AdvertiseBanner.tsx b/src/components/Home/AdvertiseBanner.tsx new file mode 100644 index 00000000..781ff293 --- /dev/null +++ b/src/components/Home/AdvertiseBanner.tsx @@ -0,0 +1,57 @@ +import React, { useState } from 'react'; +import Carousel from 'react-native-reanimated-carousel'; +import { View, Text, Linking, Pressable, Dimensions } from 'react-native'; + +import AdvertiseBanner1 from '@assets/images/Home/AdvertiseBanner1.svg'; +import AdvertiseBanner2 from '@assets/images/Home/AdvertiseBanner2.svg'; + +const AdvertiseBannerComponent: React.FC = () => { + const [advertiseIndex, setAdvertiseIndex] = useState(0); + + const width = Dimensions.get('window').width; + + // 이미지와 URL을 객체로 묶어서 배열로 설정 + const advertiseBanners = [ + { image: AdvertiseBanner1, url: 'https://www.naver.com' }, + { image: AdvertiseBanner2, url: 'https://www.naver.com' }, + ]; + + // 이미지 클릭 시 해당 URL로 이동 + const handleImagePress = (url: string) => { + Linking.openURL(url); + }; + + return ( + + setAdvertiseIndex(index)} + style={{ borderRadius: 12 }} + renderItem={({ index }) => { + const ImageComponent = advertiseBanners[index].image; + const url = advertiseBanners[index].url; + return ( + handleImagePress(url)}> + {/* SVG 이미지 렌더링 */} + + + + ); + }} + /> + + + {advertiseIndex + 1} + / 2 + + + ); +}; + +export default AdvertiseBannerComponent; diff --git a/src/components/Search/ArrivalSearchBox.tsx b/src/components/Search/ArrivalSearchBox.tsx index adf8dd92..c52dd236 100644 --- a/src/components/Search/ArrivalSearchBox.tsx +++ b/src/components/Search/ArrivalSearchBox.tsx @@ -17,19 +17,14 @@ interface ArrivalSearchBoxProps { } /** 검색 바 */ -const ArrivalSearchBoxComponent: React.FC = ({ - keyword, - handleKeyword, -}) => { +const ArrivalSearchBoxComponent: React.FC = ({ keyword, handleKeyword }) => { // focusing ref const inputRef = React.useRef(null); const navigate = useNavigation(); // input value onChange 함수 - const valueHandleChange = ( - e: NativeSyntheticEvent, - ) => { + const valueHandleChange = (e: NativeSyntheticEvent) => { handleKeyword(e.nativeEvent.text); }; @@ -49,12 +44,12 @@ const ArrivalSearchBoxComponent: React.FC = ({ {/** 검색창 */} - + = ({ const navigate = useNavigation(); // input value onChange 함수 - const valueHandleChange = ( - e: NativeSyntheticEvent, - ) => { + const valueHandleChange = (e: NativeSyntheticEvent) => { handleKeyword(e.nativeEvent.text); }; @@ -49,12 +47,12 @@ const DepartureSearchBoxComponent: React.FC = ({ {/** 검색창 */} - + = ({ - keyword, - setKeyword, -}) => { +const SearchBoxComponent: React.FC = ({ keyword, setKeyword }) => { // focusing ref const inputRef = React.useRef(null); const navigate = useNavigation(); // input value onChange 함수 - const valueHandleChange = ( - e: NativeSyntheticEvent, - ) => { + const valueHandleChange = (e: NativeSyntheticEvent) => { setKeyword(e.nativeEvent.text); }; @@ -51,12 +46,12 @@ const SearchBoxComponent: React.FC = ({ {/** 검색창 */} - + - + { /> }> + {/* 광고배너 */} + + {/* 지도, 택시팟 */} diff --git a/yarn.lock b/yarn.lock index fa66e491..1626df09 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8622,7 +8622,7 @@ react-native-fast-image@^8.6.3: resolved "https://registry.npmjs.org/react-native-fast-image/-/react-native-fast-image-8.6.3.tgz" integrity sha512-Sdw4ESidXCXOmQ9EcYguNY2swyoWmx53kym2zRsvi+VeFCHEdkO+WG1DK+6W81juot40bbfLNhkc63QnWtesNg== -react-native-gesture-handler@*, react-native-gesture-handler@^2.16.0, react-native-gesture-handler@>=1.10.1: +react-native-gesture-handler@*, react-native-gesture-handler@^2.16.0, react-native-gesture-handler@>=1.10.1, react-native-gesture-handler@>=2.0.0: version "2.16.0" resolved "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.16.0.tgz" integrity sha512-1hFkx7RIfeJSyTQQ0Nkv4icFVZ5+XjQkd47OgZMBFzoB7ecL+nFSz8KLi3OCWOhq+nbHpSPlSG5VF3CQNCJpWA== @@ -8705,7 +8705,12 @@ react-native-permissions@^4.1.4: resolved "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-4.1.4.tgz" integrity sha512-el6u90VZNFDEtmHpSheirwRhGvs6M5rSZcoqIqB128IPO00f2c1q+PP4kEaM1u19Q0ldQ+R+S7C/l8Zrduy6JQ== -react-native-reanimated@^3.8.1, react-native-reanimated@>=2.0.0, react-native-reanimated@>=2.2.0: +react-native-reanimated-carousel@^3.5.1: + version "3.5.1" + resolved "https://registry.npmjs.org/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.5.1.tgz" + integrity sha512-9BBQV6JAYSQm2lV7MFtT4mzapXmW4IZO6s38gfiJL84Jg23ivGB1UykcNQauKgtHyhtW2NuZJzItb1s42lM+hA== + +react-native-reanimated@^3.8.1, react-native-reanimated@>=2.0.0, react-native-reanimated@>=2.2.0, react-native-reanimated@>=3.0.0: version "3.8.1" resolved "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.8.1.tgz" integrity sha512-EdM0vr3JEaNtqvstqESaPfOBy0gjYBkr1iEolWJ82Ax7io8y9OVUIphgsLKTB36CtR1XtmBw0RZVj7KArc7ZVA== @@ -8821,7 +8826,7 @@ react-native-toast-message@^2.2.0: ws "^6.2.2" yargs "^17.6.2" -react-native@*, "react-native@^0.0.0-0 || >=0.60 <1.0", "react-native@^0.61.5 || ^0.62.3 || ^0.63.2 || ^0.64.2 || ^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0 || ^0.73.0", react-native@^0.73.0, "react-native@>= 0.60.0", "react-native@>= 0.64.3", react-native@>=0.46, react-native@>=0.57.0, react-native@>=0.59.0, react-native@>=0.60.0, react-native@>=0.61.3, react-native@>=0.65.0, react-native@>=0.70.0, react-native@0.73.5: +react-native@*, "react-native@^0.0.0-0 || >=0.60 <1.0", "react-native@^0.61.5 || ^0.62.3 || ^0.63.2 || ^0.64.2 || ^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.69.0 || ^0.70.0 || ^0.71.0 || ^0.72.0 || ^0.73.0", react-native@^0.73.0, "react-native@>= 0.60.0", "react-native@>= 0.64.3", react-native@>=0.46, react-native@>=0.57.0, react-native@>=0.59.0, react-native@>=0.6.0, react-native@>=0.60.0, react-native@>=0.61.3, react-native@>=0.65.0, react-native@>=0.70.0, react-native@0.73.5: version "0.73.5" resolved "https://registry.npmjs.org/react-native/-/react-native-0.73.5.tgz" integrity sha512-iHgDArmF4CrhL0qTj+Rn+CBN5pZWUL9lUGl8ub+V9Hwu/vnzQQh8rTMVSwVd2sV6N76KjpE5a4TfIAHkpIHhKg== @@ -8892,7 +8897,7 @@ react-test-renderer@18.2.0: react-shallow-renderer "^16.15.0" scheduler "^0.23.0" -react@*, "react@^16.0.0 || ^17.0.0 || ^18.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17 || ^18", react@^18.0.0, react@^18.2.0, "react@>= 16.11.0", "react@>= 17.0.1", react@>=16.11.0, react@>=16.13.1, react@>=16.8, react@>=17.0.0, react@>=18.1.0, "react@15.x || 16.x || 17.x || 18.x", "react@16.9.0 || 16.11.0 || 16.13.1 || 17.0.1 || 17.0.2 || 18.0.0 || 18.1.0 || 18.2.0", react@18.2.0: +react@*, "react@^16.0.0 || ^17.0.0 || ^18.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17 || ^18", react@^18.0.0, react@^18.2.0, "react@>= 16.11.0", "react@>= 17.0.1", react@>=16.11.0, react@>=16.13.1, react@>=16.8, react@>=16.8.0, react@>=17.0.0, react@>=18.1.0, "react@15.x || 16.x || 17.x || 18.x", "react@16.9.0 || 16.11.0 || 16.13.1 || 17.0.1 || 17.0.2 || 18.0.0 || 18.1.0 || 18.2.0", react@18.2.0: version "18.2.0" resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From d35275e2f3902700ad6d8eeb46e3ab1a7902c661 Mon Sep 17 00:00:00 2001 From: seungboshim Date: Sun, 29 Sep 2024 17:56:11 +0900 Subject: [PATCH 2/5] MI-426 refactor: separate state,types --- package-lock.json | 12 ------------ src/recoil/{recoil.ts => states/map.ts} | 15 +++------------ src/recoil/states/search.ts | 12 ++++++++++++ src/recoil/type.ts | 19 ------------------- src/recoil/types/map.ts | 10 ++++++++++ src/recoil/types/search.ts | 5 +++++ src/screens/map/DepartureMap.tsx | 3 ++- src/screens/map/MainMap.tsx | 2 +- src/screens/room/CreateRoom.tsx | 2 +- src/screens/room/PatchRoom.tsx | 2 +- src/screens/search/DepartureSearch.tsx | 2 +- src/screens/search/HomeSearch.tsx | 2 +- src/screens/search/MainMapSearch.tsx | 2 +- 13 files changed, 38 insertions(+), 50 deletions(-) rename src/recoil/{recoil.ts => states/map.ts} (53%) create mode 100644 src/recoil/states/search.ts delete mode 100644 src/recoil/type.ts create mode 100644 src/recoil/types/map.ts create mode 100644 src/recoil/types/search.ts diff --git a/package-lock.json b/package-lock.json index f138fbed..eabc6044 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16466,8 +16466,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "inBundle": true, "license": "MIT", "dependencies": { @@ -17082,8 +17080,6 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "inBundle": true, "license": "ISC", "dependencies": { @@ -17129,8 +17125,6 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "inBundle": true, "license": "MIT" }, @@ -18274,8 +18268,6 @@ }, "node_modules/npm/node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "inBundle": true, "license": "ISC", "dependencies": { @@ -18695,8 +18687,6 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "inBundle": true, "license": "MIT", "dependencies": { @@ -18731,8 +18721,6 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "inBundle": true, "license": "MIT", "dependencies": { diff --git a/src/recoil/recoil.ts b/src/recoil/states/map.ts similarity index 53% rename from src/recoil/recoil.ts rename to src/recoil/states/map.ts index 606ae0cf..d2ed8ddb 100644 --- a/src/recoil/recoil.ts +++ b/src/recoil/states/map.ts @@ -1,6 +1,6 @@ -import { atom } from 'recoil'; +import { atom } from "recoil"; -import { ArrivalRecoil, DepartureRecoil, SearchParamRecoil } from '@recoil/type'; +import { ArrivalRecoil, DepartureRecoil } from "@recoil/types/map"; // 방 생성 시 출발지 export const departureRecoilState = atom({ @@ -19,13 +19,4 @@ export const arrivalRecoilState = atom({ name: '', spotId: 0, }, -}); - -export const searchParamRecoilState = atom({ - key: 'searchParamRecoilState', - default: { - title: '', - longitude: 126.656496, - latitude: 37.451062, - }, -}); +}); \ No newline at end of file diff --git a/src/recoil/states/search.ts b/src/recoil/states/search.ts new file mode 100644 index 00000000..dfdae96d --- /dev/null +++ b/src/recoil/states/search.ts @@ -0,0 +1,12 @@ +import { atom } from "recoil"; + +import { SearchParamRecoil } from "@recoil/types/search"; + +export const searchParamRecoilState = atom({ + key: 'searchParamRecoilState', + default: { + title: '', + longitude: 126.656496, + latitude: 37.451062, + }, +}); \ No newline at end of file diff --git a/src/recoil/type.ts b/src/recoil/type.ts deleted file mode 100644 index 8e99a9ac..00000000 --- a/src/recoil/type.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Bank } from '@type/entity/account'; -import { UserPreview } from '@type/entity/user'; - -export type DepartureRecoil = { - name: string; - latitude: number; - longitude: number; -}; - -export type ArrivalRecoil = { - name: string; - spotId: number; -}; - -export type SearchParamRecoil = { - title: string; - latitude: number; - longitude: number; -}; diff --git a/src/recoil/types/map.ts b/src/recoil/types/map.ts new file mode 100644 index 00000000..126ef1d1 --- /dev/null +++ b/src/recoil/types/map.ts @@ -0,0 +1,10 @@ +export type DepartureRecoil = { + name: string; + latitude: number; + longitude: number; +}; + +export type ArrivalRecoil = { + name: string; + spotId: number; +}; \ No newline at end of file diff --git a/src/recoil/types/search.ts b/src/recoil/types/search.ts new file mode 100644 index 00000000..5d44ed49 --- /dev/null +++ b/src/recoil/types/search.ts @@ -0,0 +1,5 @@ +export type SearchParamRecoil = { + title: string; + latitude: number; + longitude: number; +}; \ No newline at end of file diff --git a/src/screens/map/DepartureMap.tsx b/src/screens/map/DepartureMap.tsx index a3b1ca26..6dae4318 100644 --- a/src/screens/map/DepartureMap.tsx +++ b/src/screens/map/DepartureMap.tsx @@ -7,7 +7,8 @@ import { Camera, NaverMapView, NaverMapViewRef } from '@mj-studio/react-native-n import TransparentSearchBoxComponent from '@components/Search/TransparentSearchBox'; -import { departureRecoilState, searchParamRecoilState } from '@recoil/recoil'; +import { departureRecoilState } from '@recoil/states/map'; +import { searchParamRecoilState } from '@recoil/states/search'; import { useDeleteAllNotifee } from '@hooks/notifee'; import { useReverseGeocoding } from '@hooks/api/search'; diff --git a/src/screens/map/MainMap.tsx b/src/screens/map/MainMap.tsx index 21f3421b..4e475e0c 100644 --- a/src/screens/map/MainMap.tsx +++ b/src/screens/map/MainMap.tsx @@ -29,7 +29,7 @@ import SelectedRoomDigestComponent from '@components/RoomDigest/SelectedRoomDige import { UserRecoil } from '@recoil/types/user'; import { userRecoilState } from '@recoil/states/user'; -import { searchParamRecoilState } from '@recoil/recoil'; +import { searchParamRecoilState } from '@recoil/states/search'; import { useIsOldiPhone } from '@hooks/device'; import { useGetSpotMap } from '@hooks/api/spot'; diff --git a/src/screens/room/CreateRoom.tsx b/src/screens/room/CreateRoom.tsx index a7fe5c30..51e0d6f9 100644 --- a/src/screens/room/CreateRoom.tsx +++ b/src/screens/room/CreateRoom.tsx @@ -18,7 +18,7 @@ import { UserRecoil } from '@recoil/types/user'; import { userRecoilState } from '@recoil/states/user'; import { CurrentRoomRecoil } from '@recoil/types/room'; import { currentRoomRecoilState } from '@recoil/states/room'; -import { arrivalRecoilState, departureRecoilState } from '@recoil/recoil'; +import { arrivalRecoilState, departureRecoilState } from '@recoil/states/map'; import SuspenseErrorHandler from '@server/errorHandler/suspenseErrorHandler'; diff --git a/src/screens/room/PatchRoom.tsx b/src/screens/room/PatchRoom.tsx index b53d0ee4..bdf10560 100644 --- a/src/screens/room/PatchRoom.tsx +++ b/src/screens/room/PatchRoom.tsx @@ -16,7 +16,7 @@ import TransparentLoadingComponent from '@components/Common/TransparentLoading'; import { UserRecoil } from '@recoil/types/user'; import { userRecoilState } from '@recoil/states/user'; -import { arrivalRecoilState, departureRecoilState } from '@recoil/recoil'; +import { arrivalRecoilState, departureRecoilState } from '@recoil/states/map'; import SuspenseErrorHandler from '@server/errorHandler/suspenseErrorHandler'; diff --git a/src/screens/search/DepartureSearch.tsx b/src/screens/search/DepartureSearch.tsx index a31d3f9f..51391264 100644 --- a/src/screens/search/DepartureSearch.tsx +++ b/src/screens/search/DepartureSearch.tsx @@ -8,7 +8,7 @@ import RecommendedSearchComponent from '@components/Search/RecommendedSearch'; import EmptySearchRenderComponent from '@components/Search/EmptySearchRender'; import DepartureSearchBoxComponent from '@components/Search/DepartureSearchBox'; -import { searchParamRecoilState } from '@recoil/recoil'; +import { searchParamRecoilState } from '@recoil/states/search'; import { useNaverSearch } from '@hooks/api/search'; import { useDeleteAllNotifee } from '@hooks/notifee'; diff --git a/src/screens/search/HomeSearch.tsx b/src/screens/search/HomeSearch.tsx index bd3b6443..1dd74e09 100644 --- a/src/screens/search/HomeSearch.tsx +++ b/src/screens/search/HomeSearch.tsx @@ -10,7 +10,7 @@ import SearchBoxComponent from '@components/Search/SearchBox'; import RecommendedSearchComponent from '@components/Search/RecommendedSearch'; import EmptySearchRenderComponent from '@components/Search/EmptySearchRender'; -import { searchParamRecoilState } from '@recoil/recoil'; +import { searchParamRecoilState } from '@recoil/states/search'; import { useNaverSearch } from '@hooks/api/search'; import { useDeleteAllNotifee } from '@hooks/notifee'; diff --git a/src/screens/search/MainMapSearch.tsx b/src/screens/search/MainMapSearch.tsx index ad88bf55..ce83cd39 100644 --- a/src/screens/search/MainMapSearch.tsx +++ b/src/screens/search/MainMapSearch.tsx @@ -10,7 +10,7 @@ import SearchBoxComponent from '@components/Search/SearchBox'; import RecommendedSearchComponent from '@components/Search/RecommendedSearch'; import EmptySearchRenderComponent from '@components/Search/EmptySearchRender'; -import { searchParamRecoilState } from '@recoil/recoil'; +import { searchParamRecoilState } from '@recoil/states/search'; import { useNaverSearch } from '@hooks/api/search'; import { useDeleteAllNotifee } from '@hooks/notifee'; From 77ee280ff559f9773bdef54b823f1562eac5162c Mon Sep 17 00:00:00 2001 From: seungboshim Date: Sun, 29 Sep 2024 18:06:20 +0900 Subject: [PATCH 3/5] MI-429 specify recoil types --- src/screens/map/DepartureMap.tsx | 6 ++++-- src/screens/map/MainMap.tsx | 3 ++- src/screens/room/CreateRoom.tsx | 5 +++-- src/screens/room/PatchRoom.tsx | 5 +++-- src/screens/search/DepartureSearch.tsx | 3 ++- src/screens/search/HomeSearch.tsx | 3 ++- src/screens/search/MainMapSearch.tsx | 3 ++- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/screens/map/DepartureMap.tsx b/src/screens/map/DepartureMap.tsx index 6dae4318..3bb2a40a 100644 --- a/src/screens/map/DepartureMap.tsx +++ b/src/screens/map/DepartureMap.tsx @@ -7,6 +7,8 @@ import { Camera, NaverMapView, NaverMapViewRef } from '@mj-studio/react-native-n import TransparentSearchBoxComponent from '@components/Search/TransparentSearchBox'; +import { DepartureRecoil } from '@recoil/types/map'; +import { SearchParamRecoil } from '@recoil/types/search'; import { departureRecoilState } from '@recoil/states/map'; import { searchParamRecoilState } from '@recoil/states/search'; @@ -32,8 +34,8 @@ const DepartureMapScreen = ({ route, navigation }: DepartureMapScreenProps) => { const [searchBoxValue, setSearchBoxValue] = useState('출발지를 입력하세요'); const [isSearched, setIsSearched] = useState(false); - const [, setDepartureRecoil] = useRecoilState(departureRecoilState); - const [searchParamRecoil, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); + const [, setDepartureRecoil] = useRecoilState(departureRecoilState); + const [searchParamRecoil, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); const [buildingName, setBuildingName] = useState(''); const [isBlocked, setIsBlocked] = useState(false); diff --git a/src/screens/map/MainMap.tsx b/src/screens/map/MainMap.tsx index 4e475e0c..0e5ca4f1 100644 --- a/src/screens/map/MainMap.tsx +++ b/src/screens/map/MainMap.tsx @@ -29,6 +29,7 @@ import SelectedRoomDigestComponent from '@components/RoomDigest/SelectedRoomDige import { UserRecoil } from '@recoil/types/user'; import { userRecoilState } from '@recoil/states/user'; +import { SearchParamRecoil } from '@recoil/types/search'; import { searchParamRecoilState } from '@recoil/states/search'; import { useIsOldiPhone } from '@hooks/device'; @@ -114,7 +115,7 @@ const MainMapScreen = ({ route, navigation }: MainMapScreenProps) => { // 현재 줌에서의 탐색 범위 const [radius, setRadius] = useState(5000); - const searchParamRecoil = useRecoilValue(searchParamRecoilState); + const searchParamRecoil = useRecoilValue(searchParamRecoilState); const resetSearchParamRecoil = useResetRecoilState(searchParamRecoilState); // 검색 후 좌표설정 diff --git a/src/screens/room/CreateRoom.tsx b/src/screens/room/CreateRoom.tsx index 51e0d6f9..6323d6ff 100644 --- a/src/screens/room/CreateRoom.tsx +++ b/src/screens/room/CreateRoom.tsx @@ -18,6 +18,7 @@ import { UserRecoil } from '@recoil/types/user'; import { userRecoilState } from '@recoil/states/user'; import { CurrentRoomRecoil } from '@recoil/types/room'; import { currentRoomRecoilState } from '@recoil/states/room'; +import { ArrivalRecoil, DepartureRecoil } from '@recoil/types/map'; import { arrivalRecoilState, departureRecoilState } from '@recoil/states/map'; import SuspenseErrorHandler from '@server/errorHandler/suspenseErrorHandler'; @@ -49,8 +50,8 @@ const CreateRoomComponent = ({ navigation }: CreateRoomScreenProps) => { const { mutateAsync: createRoomMutate, isPending: createRoomPending } = useCreateRoom(); const setCurrentRoomRecoil = useSetRecoilState(currentRoomRecoilState); - const [departureRecoil, setDepartureRecoil] = useRecoilState(departureRecoilState); // 출발지 이름, 좌표 - const [arrivalRecoil, setArrivalRecoil] = useRecoilState(arrivalRecoilState); // 도착지 이름, 거점 id + const [departureRecoil, setDepartureRecoil] = useRecoilState(departureRecoilState); // 출발지 이름, 좌표 + const [arrivalRecoil, setArrivalRecoil] = useRecoilState(arrivalRecoilState); // 도착지 이름, 거점 id const [departureTime, setDepartureTime] = useState(new Date()); // 설정 날짜 const [datePicked, setDatePicked] = useState(false); // 날짜 선택 여부 const [datePickerOpen, setDatePickerOpen] = useState(false); // Datepicker open 여부 diff --git a/src/screens/room/PatchRoom.tsx b/src/screens/room/PatchRoom.tsx index bdf10560..abadcfb1 100644 --- a/src/screens/room/PatchRoom.tsx +++ b/src/screens/room/PatchRoom.tsx @@ -16,6 +16,7 @@ import TransparentLoadingComponent from '@components/Common/TransparentLoading'; import { UserRecoil } from '@recoil/types/user'; import { userRecoilState } from '@recoil/states/user'; +import { ArrivalRecoil, DepartureRecoil } from '@recoil/types/map'; import { arrivalRecoilState, departureRecoilState } from '@recoil/states/map'; import SuspenseErrorHandler from '@server/errorHandler/suspenseErrorHandler'; @@ -49,8 +50,8 @@ const PatchRoomComponent = ({ navigation, route }: PatchRoomScreenProps) => { roomDetail.roomId, ); - const [departureRecoil, setDepartureRecoil] = useRecoilState(departureRecoilState); // 출발지 이름, 좌표 - const [arrivalRecoil, setArrivalRecoil] = useRecoilState(arrivalRecoilState); // 도착지 이름, 거점 id + const [departureRecoil, setDepartureRecoil] = useRecoilState(departureRecoilState); // 출발지 이름, 좌표 + const [arrivalRecoil, setArrivalRecoil] = useRecoilState(arrivalRecoilState); // 도착지 이름, 거점 id const [departureTime, setDepartureTime] = useState(new Date()); // 설정 날짜 const [datePicked, setDatePicked] = useState(true); // 날짜 선택 여부 const [datePickerOpen, setDatePickerOpen] = useState(false); // Datepicker open 여부 diff --git a/src/screens/search/DepartureSearch.tsx b/src/screens/search/DepartureSearch.tsx index 51391264..26643544 100644 --- a/src/screens/search/DepartureSearch.tsx +++ b/src/screens/search/DepartureSearch.tsx @@ -8,6 +8,7 @@ import RecommendedSearchComponent from '@components/Search/RecommendedSearch'; import EmptySearchRenderComponent from '@components/Search/EmptySearchRender'; import DepartureSearchBoxComponent from '@components/Search/DepartureSearchBox'; +import { SearchParamRecoil } from '@recoil/types/search'; import { searchParamRecoilState } from '@recoil/states/search'; import { useNaverSearch } from '@hooks/api/search'; @@ -26,7 +27,7 @@ const DepartureSearchScreen = ({ navigation }: DepartureSearchScreenProps) => { /** 검색어 저장 변수 */ const [keyword, setKeyword] = useState(''); - const [, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); + const [, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); const locationPermission = useLocationPermission(); const { data: items, refetch: refetchNaverSearch } = useNaverSearch(keyword); diff --git a/src/screens/search/HomeSearch.tsx b/src/screens/search/HomeSearch.tsx index 1dd74e09..6b2e7146 100644 --- a/src/screens/search/HomeSearch.tsx +++ b/src/screens/search/HomeSearch.tsx @@ -10,6 +10,7 @@ import SearchBoxComponent from '@components/Search/SearchBox'; import RecommendedSearchComponent from '@components/Search/RecommendedSearch'; import EmptySearchRenderComponent from '@components/Search/EmptySearchRender'; +import { SearchParamRecoil } from '@recoil/types/search'; import { searchParamRecoilState } from '@recoil/states/search'; import { useNaverSearch } from '@hooks/api/search'; @@ -42,7 +43,7 @@ const HomeSearchScreen = ({ route, navigation }: HomeSearchScreenProps) => { }); // 검색어 선택시 넘겨줄 값 - const [, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); + const [, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); useEffect(() => { const fetchCurrentLocation = async () => { diff --git a/src/screens/search/MainMapSearch.tsx b/src/screens/search/MainMapSearch.tsx index ce83cd39..76fb6978 100644 --- a/src/screens/search/MainMapSearch.tsx +++ b/src/screens/search/MainMapSearch.tsx @@ -10,6 +10,7 @@ import SearchBoxComponent from '@components/Search/SearchBox'; import RecommendedSearchComponent from '@components/Search/RecommendedSearch'; import EmptySearchRenderComponent from '@components/Search/EmptySearchRender'; +import { SearchParamRecoil } from '@recoil/types/search'; import { searchParamRecoilState } from '@recoil/states/search'; import { useNaverSearch } from '@hooks/api/search'; @@ -37,7 +38,7 @@ const SearchScreen = ({ navigation }: SearchScreenProps) => { }); // 검색어 선택시 넘겨줄 값 - const [, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); + const [, setSearchParamRecoil] = useRecoilState(searchParamRecoilState); useEffect(() => { const fetchCurrentLocation = async () => { From 5b30e3f46d857d820afea7443a252484539c1d1b Mon Sep 17 00:00:00 2001 From: seungboshim Date: Sun, 29 Sep 2024 18:10:23 +0900 Subject: [PATCH 4/5] MI-426 fix rest recoil type --- src/screens/map/ArrivalMap.tsx | 5 +++-- src/screens/map/MainMap.tsx | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/screens/map/ArrivalMap.tsx b/src/screens/map/ArrivalMap.tsx index 040a5eb4..2ae20248 100644 --- a/src/screens/map/ArrivalMap.tsx +++ b/src/screens/map/ArrivalMap.tsx @@ -13,7 +13,8 @@ import { import SpotMarker from '@components/Marker/SpotMarker'; import TransparentSearchBoxComponent from '@components/Search/TransparentSearchBox'; -import { arrivalRecoilState } from '@recoil/recoil'; +import { ArrivalRecoil } from '@recoil/types/map'; +import { arrivalRecoilState } from '@recoil/states/map'; import { useGetSpotMap } from '@hooks/api/spot'; import { useDeleteAllNotifee } from '@hooks/notifee'; @@ -115,7 +116,7 @@ const ArrivalMapScreen = ({ route, navigation }: ArrivalMapScreenProps) => { }; // 도착 거점을 저장하며 이동 - const [, setArrivalRecoil] = useRecoilState(arrivalRecoilState); + const [, setArrivalRecoil] = useRecoilState(arrivalRecoilState); const handleSelectArrival = () => { if (route.params?.isPatch) { navigation.pop(2); diff --git a/src/screens/map/MainMap.tsx b/src/screens/map/MainMap.tsx index 0e5ca4f1..0d707291 100644 --- a/src/screens/map/MainMap.tsx +++ b/src/screens/map/MainMap.tsx @@ -19,9 +19,8 @@ import BottomSheet, { BottomSheetBackdropProps, } from '@gorhom/bottom-sheet'; -import MapBottomSheetScreen from '../../components/Modal/MapBottomSheet'; - import RoomMarkerComponent from '@components/Marker/RoomMarker'; +import MapBottomSheetScreen from '@components/Modal/MapBottomSheet'; import CreateRoomButtonComponent from '@components/CreateRoomButton'; import SpotFilterModalScreen from '@components/Modal/SpotFilterModal'; import TransparentSearchBoxComponent from '@components/Search/TransparentSearchBox'; From 9817b4bb07f9d0194faf4f353e007f6d1c1e559d Mon Sep 17 00:00:00 2001 From: gkqkehs7 <77993709+gkqkehs7@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:24:48 +0900 Subject: [PATCH 5/5] Add advertise banner link --- src/components/Home/AdvertiseBanner.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Home/AdvertiseBanner.tsx b/src/components/Home/AdvertiseBanner.tsx index 781ff293..3f084cfe 100644 --- a/src/components/Home/AdvertiseBanner.tsx +++ b/src/components/Home/AdvertiseBanner.tsx @@ -12,8 +12,14 @@ const AdvertiseBannerComponent: React.FC = () => { // 이미지와 URL을 객체로 묶어서 배열로 설정 const advertiseBanners = [ - { image: AdvertiseBanner1, url: 'https://www.naver.com' }, - { image: AdvertiseBanner2, url: 'https://www.naver.com' }, + { + image: AdvertiseBanner1, + url: 'https://material-roquefort-92e.notion.site/18c75d54626c41cebb05838bffae800f?pvs=4', + }, + { + image: AdvertiseBanner2, + url: 'https://material-roquefort-92e.notion.site/100-40f440e153a548dc9e3a6859ebedd71a?pvs=4', + }, ]; // 이미지 클릭 시 해당 URL로 이동