-
Notifications
You must be signed in to change notification settings - Fork 1
feat: badge modal 추가 및 record추가시 뱃지 모달 추가 #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f1ba78d
feat: badge modal 추가 및 record추가시 뱃지 모달 추가
d0422 91c19a4
fix: mypage 카드 조건부 처리
d0422 043c9a8
fix: 강원도 모달 안뜨는 문제 해결
d0422 8daa839
feat: 지역퀴즈 대체 문구 추가
d0422 ec41a9c
chore: View추가
d0422 71948a1
fix: 강원도가 0으로 표기되는 문제 해결
d0422 07c34e9
chore: 퀴즈 UI 변경점 적용
d0422 8455de8
feat: 지역 퀴즈 문구 변경
d0422 109d6d2
chore: 코드 리뷰 반영
d0422 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/react-native/src/components/common/BadgeModal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<BadgeModalProps>) { | ||
return ( | ||
<Modal visible={visible} transparent animationType="fade"> | ||
<View className="flex-1 justify-center text-center px-8"> | ||
<View className="p-4 bg-[#191919] rounded-xl"> | ||
<View className="justify-center flex-row"> | ||
{headerTitle ? ( | ||
<Font type="body1" color="white"> | ||
{headerTitle} | ||
</Font> | ||
) : null} | ||
<TouchableOpacity | ||
onPress={handleClose} | ||
className="absolute right-0" | ||
> | ||
<CancelIcon /> | ||
</TouchableOpacity> | ||
</View> | ||
{children} | ||
</View> | ||
</View> | ||
</Modal> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,57 @@ | ||
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<Region>(); | ||
const region = | ||
typeof recordModalInfo !== 'undefined' && | ||
REVERSE_REGION_MAPPER[recordModalInfo]; | ||
const navigate = useNavigation<StackNavigation<'Maps/Record'>>(); | ||
const { params } = useRoute<StackRouteProps<'Maps/PostRecord'>>(); | ||
|
||
const closeModal = () => { | ||
setRecordModalInfo(undefined); | ||
navigate.navigate('Maps/Record', { | ||
location: params.location, | ||
}); | ||
}; | ||
|
||
return ( | ||
<BackGroundGradient> | ||
<Header title="로그 등록" /> | ||
<RecordFormProvider> | ||
<RecordPostForm /> | ||
<RecordPostForm setRecordModalInfo={setRecordModalInfo} /> | ||
</RecordFormProvider> | ||
{typeof recordModalInfo !== 'undefined' && ( | ||
<BadgeModal | ||
visible={typeof recordModalInfo !== 'undefined'} | ||
handleClose={closeModal} | ||
> | ||
<View className="justify-center gap-2 flex-row items-center flex mt-6"> | ||
<Font.Bold type="title1" color="white"> | ||
{region} | ||
</Font.Bold> | ||
</View> | ||
<View className="justify-center items-center"> | ||
<Font type="body1" color="white"> | ||
배지를 1개 획득했습니다. | ||
</Font> | ||
<View className="p-4"> | ||
<Badge preventFade location={BADGE_MAPPER[recordModalInfo]} /> | ||
</View> | ||
</View> | ||
</BadgeModal> | ||
)} | ||
</BackGroundGradient> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다른곳과 일관성을 위해 headerTitle &&와 같이 적을 수 있을 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
109d6d2
반영하였습니다!