From f1ba78d8c30b264ef8188c38c45d49a745b6361c Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 00:15:36 +0900 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20badge=20modal=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20=EB=B0=8F=20record=EC=B6=94=EA=B0=80=EC=8B=9C=20=EB=B1=83?= =?UTF-8?q?=EC=A7=80=20=EB=AA=A8=EB=8B=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/BadgeModal.tsx | 40 +++++++++++++++++++ .../src/components/maps/RecordPostForm.tsx | 19 +++++---- .../src/pages/Maps/PostRecord.tsx | 39 +++++++++++++++++- 3 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 packages/react-native/src/components/common/BadgeModal.tsx diff --git a/packages/react-native/src/components/common/BadgeModal.tsx b/packages/react-native/src/components/common/BadgeModal.tsx new file mode 100644 index 00000000..2fd24e0d --- /dev/null +++ b/packages/react-native/src/components/common/BadgeModal.tsx @@ -0,0 +1,40 @@ +import { PropsWithChildren } from 'react'; +import { Modal, TouchableOpacity, View } from 'react-native'; +import { Font } from 'design-system'; +import CancelIcon from '@/assets/CancelIcon'; + +interface BadgeModalProps { + visible: boolean; + headerTitle?: string; + handleClose: () => void; +} + +export default function BadgeModal({ + visible, + headerTitle, + handleClose, + children, +}: PropsWithChildren) { + return ( + + + + + {headerTitle ? ( + + {headerTitle} + + ) : null} + + + + + {children} + + + + ); +} diff --git a/packages/react-native/src/components/maps/RecordPostForm.tsx b/packages/react-native/src/components/maps/RecordPostForm.tsx index d9206815..e714eb1b 100644 --- a/packages/react-native/src/components/maps/RecordPostForm.tsx +++ b/packages/react-native/src/components/maps/RecordPostForm.tsx @@ -2,21 +2,27 @@ import { useState } from 'react'; import { Asset } from 'react-native-image-picker'; import { Alert, View } from 'react-native'; import { Button, Font } from 'design-system'; -import { useNavigation, useRoute } from '@react-navigation/native'; +import { useRoute } from '@react-navigation/native'; import RecordFormTitle from './RecordFormTitle'; import RecordFormDatePicker from './RecordFormDatePickers'; import CalendarIcon from '@/assets/CalendarIcon'; -import { StackNavigation, StackRouteProps } from '@/types/navigation'; +import { StackRouteProps } from '@/types/navigation'; import useRecordFormState from '@/hooks/useRecordFormState'; import useGallery from '@/hooks/useGallery'; import useRecordMutation from '@/apis/mutations/useRecordMutation'; import RecordFormDescription from './RecordFormDescription'; import RecordFormCitySelect from './RecordFormCitySelect'; -import { REGION_MAPPER } from '@/constants/CITY'; +import { Region, REGION_MAPPER } from '@/constants/CITY'; import ImageSelect from '../common/ImageSelect'; import MutationLoadingModal from '../common/MutationLoadingModal'; -export default function RecordPostForm() { +interface RecordPostFormProps { + setRecordModalInfo: React.Dispatch>; +} + +export default function RecordPostForm({ + setRecordModalInfo, +}: RecordPostFormProps) { const { description, title, @@ -29,7 +35,6 @@ export default function RecordPostForm() { } = useRecordFormState(); const { params } = useRoute>(); - const navigate = useNavigation>(); const [imageAssets, setImageAssets] = useState(); const { getPhoto } = useGallery(); @@ -84,9 +89,7 @@ export default function RecordPostForm() { images: imageAssets, }); - navigate.navigate('Maps/Record', { - location: params.location, - }); + setRecordModalInfo(REGION_MAPPER[params.location]); }; return ( <> diff --git a/packages/react-native/src/pages/Maps/PostRecord.tsx b/packages/react-native/src/pages/Maps/PostRecord.tsx index ca76ce1d..79331eb0 100644 --- a/packages/react-native/src/pages/Maps/PostRecord.tsx +++ b/packages/react-native/src/pages/Maps/PostRecord.tsx @@ -1,15 +1,52 @@ +import { useState } from 'react'; +import { useNavigation, useRoute } from '@react-navigation/native'; +import { View } from 'react-native'; +import { Font } from 'design-system'; import Header from '@/components/common/Header'; import BackGroundGradient from '@/layouts/BackGroundGradient'; import { RecordFormProvider } from '@/hooks/useRecordFormState'; import RecordPostForm from '@/components/maps/RecordPostForm'; +import { BADGE_MAPPER, Region, REVERSE_REGION_MAPPER } from '@/constants/CITY'; +import Badge from '@/components/common/Badge'; +import { StackNavigation, StackRouteProps } from '@/types/navigation'; +import BadgeModal from '@/components/common/BadgeModal'; export default function PostRecord() { + const [recordModalInfo, setRecordModalInfo] = useState(); + const region = recordModalInfo && REVERSE_REGION_MAPPER[recordModalInfo]; + const navigate = useNavigation>(); + const { params } = useRoute>(); + + const closeModal = () => { + setRecordModalInfo(undefined); + navigate.navigate('Maps/Record', { + location: params.location, + }); + }; + return (
- + + {recordModalInfo && ( + + + + {region} + + + + + 배지를 1개 획득했습니다. + + + + + + + )} ); } From 91c19a424961291b29a1a595db3d9de37c3cb5e9 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 00:22:28 +0900 Subject: [PATCH 2/9] =?UTF-8?q?fix:=20mypage=20=EC=B9=B4=EB=93=9C=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=EB=B6=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react-native/src/components/mypage/MySpotBlock.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-native/src/components/mypage/MySpotBlock.tsx b/packages/react-native/src/components/mypage/MySpotBlock.tsx index 9049b59c..9bede81b 100644 --- a/packages/react-native/src/components/mypage/MySpotBlock.tsx +++ b/packages/react-native/src/components/mypage/MySpotBlock.tsx @@ -88,9 +88,11 @@ export default function MySpotBlock({ mySpot, width, gap }: MySpotBlockProps) { className="flex-1 justify-end bg-black/40" onPress={handleClick} > - - - + {!posterUrl && ( + + + + )} Date: Mon, 14 Oct 2024 00:50:19 +0900 Subject: [PATCH 3/9] =?UTF-8?q?fix:=20=EA=B0=95=EC=9B=90=EB=8F=84=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EC=95=88=EB=9C=A8=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-native/src/pages/Maps/PostRecord.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native/src/pages/Maps/PostRecord.tsx b/packages/react-native/src/pages/Maps/PostRecord.tsx index 79331eb0..863ca7d8 100644 --- a/packages/react-native/src/pages/Maps/PostRecord.tsx +++ b/packages/react-native/src/pages/Maps/PostRecord.tsx @@ -30,8 +30,11 @@ export default function PostRecord() { - {recordModalInfo && ( - + {typeof recordModalInfo !== 'undefined' && ( + {region} From 8daa839b06f2bbbda9d307217934a6b2fc810d24 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 01:11:10 +0900 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20=EC=A7=80=EC=97=AD=ED=80=B4?= =?UTF-8?q?=EC=A6=88=20=EB=8C=80=EC=B2=B4=20=EB=AC=B8=EA=B5=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react-native/src/components/gamification/QuizSlider.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/src/components/gamification/QuizSlider.tsx b/packages/react-native/src/components/gamification/QuizSlider.tsx index a36594e3..0fc11c2f 100644 --- a/packages/react-native/src/components/gamification/QuizSlider.tsx +++ b/packages/react-native/src/components/gamification/QuizSlider.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { Dimensions, View, ViewToken } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; +import { Font } from 'design-system'; import { QuizzesResponse } from '@/apis/queries/quiz/useQuizzesQuery'; import Header from '@/components/common/Header'; import BackGroundGradient from '@/layouts/BackGroundGradient'; @@ -58,6 +59,9 @@ export default function QuizSlider({ quizListData }: QuizSliderProps) { /> ))} + + 촬영지에 해당하는 퀴즈가 없는 경우, 지역 퀴즈로 대체돼요. + From ec41a9c011a7937dca0c5a13662ee51bbafa68e2 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 01:13:44 +0900 Subject: [PATCH 5/9] =?UTF-8?q?chore:=20View=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/gamification/QuizSlider.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-native/src/components/gamification/QuizSlider.tsx b/packages/react-native/src/components/gamification/QuizSlider.tsx index 0fc11c2f..a827c1a6 100644 --- a/packages/react-native/src/components/gamification/QuizSlider.tsx +++ b/packages/react-native/src/components/gamification/QuizSlider.tsx @@ -59,9 +59,11 @@ export default function QuizSlider({ quizListData }: QuizSliderProps) { /> ))} - - 촬영지에 해당하는 퀴즈가 없는 경우, 지역 퀴즈로 대체돼요. - + + + 촬영지에 해당하는 퀴즈가 없는 경우, 지역 퀴즈로 대체돼요. + + From 71948a140592dda0548b9d1a38717ce5aaad2886 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 01:22:20 +0900 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20=EA=B0=95=EC=9B=90=EB=8F=84=EA=B0=80?= =?UTF-8?q?=200=EC=9C=BC=EB=A1=9C=20=ED=91=9C=EA=B8=B0=EB=90=98=EB=8A=94?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-native/src/pages/Maps/PostRecord.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/src/pages/Maps/PostRecord.tsx b/packages/react-native/src/pages/Maps/PostRecord.tsx index 863ca7d8..50abd9c5 100644 --- a/packages/react-native/src/pages/Maps/PostRecord.tsx +++ b/packages/react-native/src/pages/Maps/PostRecord.tsx @@ -13,7 +13,9 @@ import BadgeModal from '@/components/common/BadgeModal'; export default function PostRecord() { const [recordModalInfo, setRecordModalInfo] = useState(); - const region = recordModalInfo && REVERSE_REGION_MAPPER[recordModalInfo]; + const region = + typeof recordModalInfo !== 'undefined' && + REVERSE_REGION_MAPPER[recordModalInfo]; const navigate = useNavigation>(); const { params } = useRoute>(); From 07c34e9132ebe194c16af2bd0702405c2e99f0d8 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 01:42:50 +0900 Subject: [PATCH 7/9] =?UTF-8?q?chore:=20=ED=80=B4=EC=A6=88=20UI=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=A0=90=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/gamification/QuizSlider.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-native/src/components/gamification/QuizSlider.tsx b/packages/react-native/src/components/gamification/QuizSlider.tsx index a827c1a6..36a14f82 100644 --- a/packages/react-native/src/components/gamification/QuizSlider.tsx +++ b/packages/react-native/src/components/gamification/QuizSlider.tsx @@ -27,7 +27,7 @@ export default function QuizSlider({ quizListData }: QuizSliderProps) { return (
- + ))} - - - 촬영지에 해당하는 퀴즈가 없는 경우, 지역 퀴즈로 대체돼요. - - + + + + 촬영지에 해당하는 퀴즈가 없는 경우, 지역 퀴즈로 대체됩니다! + From 8455de8edd61916ffd51fac3fa20685572c11677 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 21:55:28 +0900 Subject: [PATCH 8/9] =?UTF-8?q?feat:=20=EC=A7=80=EC=97=AD=20=ED=80=B4?= =?UTF-8?q?=EC=A6=88=20=EB=AC=B8=EA=B5=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/gamification/QuizSlider.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/react-native/src/components/gamification/QuizSlider.tsx b/packages/react-native/src/components/gamification/QuizSlider.tsx index 36a14f82..249dadec 100644 --- a/packages/react-native/src/components/gamification/QuizSlider.tsx +++ b/packages/react-native/src/components/gamification/QuizSlider.tsx @@ -60,10 +60,15 @@ export default function QuizSlider({ quizListData }: QuizSliderProps) { ))} - - - 촬영지에 해당하는 퀴즈가 없는 경우, 지역 퀴즈로 대체됩니다! - + + + + 촬영지에 해당하는 퀴즈가 없는 경우 + + + 지역 퀴즈로 대체됩니다! + + From 109d6d2d50510b5727b892936e4b4547a090d741 Mon Sep 17 00:00:00 2001 From: d0422 Date: Mon, 14 Oct 2024 22:00:28 +0900 Subject: [PATCH 9/9] =?UTF-8?q?chore:=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-native/src/components/common/BadgeModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/src/components/common/BadgeModal.tsx b/packages/react-native/src/components/common/BadgeModal.tsx index 2fd24e0d..c068f2b0 100644 --- a/packages/react-native/src/components/common/BadgeModal.tsx +++ b/packages/react-native/src/components/common/BadgeModal.tsx @@ -20,11 +20,11 @@ export default function BadgeModal({ - {headerTitle ? ( + {headerTitle && ( {headerTitle} - ) : null} + )}