-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #918 from 42organization/GGFE-164-구매-선물-모달
[GGFE-164] 구매 선물 모달
- Loading branch information
Showing
12 changed files
with
319 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,26 @@ | ||
import useNoCoinModal from 'hooks/modal/store/purchase/useNoCoinModal'; | ||
import styles from 'styles/modal/store/NoCoinModal.module.scss'; | ||
|
||
export default function NoCoinModal() { | ||
const { onPlay, onCancel } = useNoCoinModal(); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.phrase}> | ||
<div className={styles.emoji}>😥</div> | ||
<div className={styles.message}>보유 코인이 부족합니다</div> | ||
<div className={styles.details}> | ||
💸게임에 참여하여 코인을 획득해보세요💸 | ||
</div> | ||
</div> | ||
<div className={styles.buttons}> | ||
<div className={styles.negative}> | ||
<input onClick={onCancel} type='button' value='취소' /> | ||
</div> | ||
<div className={styles.positive}> | ||
<input onClick={onPlay} type='button' value='게임 참여' /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains 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,72 @@ | ||
import { GoSearch } from 'react-icons/go'; | ||
import { useEffect, Dispatch, SetStateAction } from 'react'; | ||
import { IoIosCloseCircle } from 'react-icons/io'; | ||
import styles from 'styles/main/SearchBar.module.scss'; | ||
import useSearchBar from 'hooks/useSearchBar'; | ||
|
||
export default function GiftSearchBar({ | ||
recipient, | ||
setRecipient, | ||
}: { | ||
recipient: string; | ||
setRecipient: Dispatch<SetStateAction<string>>; | ||
}) { | ||
const { | ||
keyword, | ||
setKeyword, | ||
keywordHandler, | ||
showDropDown, | ||
setShowDropDown, | ||
searchResult, | ||
searchBarRef, | ||
handleKeyDown, | ||
} = useSearchBar(); | ||
|
||
const handleClick = ( | ||
event: React.MouseEvent<HTMLDivElement, MouseEvent>, | ||
intraId: string | ||
) => { | ||
setKeyword(intraId); | ||
setRecipient(intraId); | ||
setShowDropDown(false); | ||
}; | ||
|
||
return ( | ||
<div id={styles.gift} className={styles.searchBar} ref={searchBarRef}> | ||
<input | ||
type='text' | ||
onChange={keywordHandler} | ||
onKeyDown={handleKeyDown} | ||
onFocus={() => setShowDropDown(true)} | ||
placeholder='선물할 유저 검색하기' | ||
maxLength={15} | ||
value={keyword} | ||
/> | ||
<div className={styles.icons}> | ||
{keyword ? ( | ||
<span className={styles.reset} onClick={() => setKeyword('')}> | ||
<IoIosCloseCircle /> | ||
</span> | ||
) : ( | ||
<span> | ||
<GoSearch /> | ||
</span> | ||
)} | ||
</div> | ||
{showDropDown && keyword && ( | ||
<div className={styles.dropdown}> | ||
{searchResult.length ? ( | ||
searchResult.map((intraId: string) => ( | ||
// TODO: 선택한 유저 아이디를 FOR '검색한 사람 아이디' 부분에 넣어주기 | ||
<div key={intraId} onClick={(e) => handleClick(e, intraId)}> | ||
{intraId} | ||
</div> | ||
)) | ||
) : ( | ||
<div>검색 결과가 없습니다.</div> | ||
)} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains 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 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,20 @@ | ||
import { useSetRecoilState } from 'recoil'; | ||
import { modalState } from 'utils/recoil/modal'; | ||
import router from 'next/router'; | ||
|
||
const useNoCoinModal = () => { | ||
const setModal = useSetRecoilState(modalState); | ||
|
||
const onPlay = () => { | ||
setModal({ modalName: null }); | ||
router.push(`/match`); | ||
}; | ||
|
||
const onCancel = () => { | ||
setModal({ modalName: null }); | ||
}; | ||
|
||
return { onPlay, onCancel }; | ||
}; | ||
|
||
export default useNoCoinModal; |
This file contains 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 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
Oops, something went wrong.