-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feat: 내 체험 관리, 체험 등록 form #35
Merged
The head ref may contain hidden characters: "feature-\uD669\uC740\uC9C0"
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0dda127
Fix: sideNavigation 체험 관리 클릭 시 라우팅 수정
eunji-0623 ebe6cc4
Feat: 내 체험 관리 페이지 사이드 네비게이션 연결
eunji-0623 f9eacae
Feat: 내 체험 내역 api 연결 및 무한스크롤 기능 추가
eunji-0623 7e5d048
Style: hooks 폴더 구조 변경
eunji-0623 4d0eed5
Style: hooks 폴더 구조 변경
eunji-0623 34f4047
Feat: 내 체험 삭제 기능 추가
eunji-0623 52b9b7d
Fix: 로그인 전에 체험을 불러오던 오류 수정
eunji-0623 1c543f0
Feat: 주소 daum 우편 api 사용하는 방식으로 변경
eunji-0623 0d6b0ef
Fix: 내 체험 관리 > 카드 이미지 사이즈 오류 수정
eunji-0623 442a9d0
Fix: form 제출 시 내 체험 목록 페이지로 이동하도록 변경
eunji-0623 0545ca9
Fix: 빌드 오류 수정
eunji-0623 94cf8ff
Fix: url 소문자로 변경
eunji-0623 4e617e0
Fix: 폴더 이름 소문자로 변경
eunji-0623 be88012
Fix: 폴더 이름 소문자로 변경
eunji-0623 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
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,40 @@ | ||
import AddressPopup from '@/components/Popup/AddressPopup'; | ||
import { addressState } from '@/states/registerState'; | ||
import { useState } from 'react'; | ||
import { useRecoilValue } from 'recoil'; | ||
|
||
function AddressInput() { | ||
const address = useRecoilValue(addressState); | ||
const [isPopupOpen, setIsPopupOpen] = useState(false); | ||
|
||
const handleInputClick = () => { | ||
setIsPopupOpen(!isPopupOpen); | ||
}; | ||
|
||
const closePopup = () => { | ||
setIsPopupOpen(false); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<label | ||
className="text-[24px] font-bold block mb-[16px]" | ||
htmlFor="address" | ||
> | ||
주소 | ||
</label> | ||
<input | ||
type="text" | ||
id="address" | ||
value={address} | ||
onClick={handleInputClick} | ||
className="w-full h-[56px] py-[8px] px-[16px] rounded-md border border-var-gray6 bg-white" | ||
readOnly | ||
placeholder="주소" | ||
/> | ||
{isPopupOpen && <AddressPopup closePopup={closePopup} />} | ||
</div> | ||
); | ||
} | ||
|
||
export default AddressInput; |
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,40 @@ | ||
import { addressState } from '@/states/registerState'; | ||
import React, { useEffect, useState } from 'react'; | ||
import DaumPostcode from 'react-daum-postcode'; | ||
import { useRecoilState } from 'recoil'; | ||
import { AddressPopupProps } from './Popup.types'; | ||
|
||
const style = { | ||
width: '400px', | ||
height: '600px', | ||
}; | ||
|
||
const AddressPopup = ({ closePopup }: AddressPopupProps) => { | ||
const [address, setAddress] = useRecoilState(addressState); | ||
|
||
const handleComplete = (data: any) => { | ||
let fullAddress = data.address; | ||
setAddress(fullAddress); | ||
}; | ||
|
||
const handleClose = (state: string) => { | ||
if (state === 'FORCE_CLOSE') { | ||
closePopup(); | ||
} else if (state === 'COMPLETE_CLOSE') { | ||
closePopup(); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="flex items-center justify-center bg-black bg-opacity-70 fixed inset-0 z-50"> | ||
<DaumPostcode | ||
style={style} | ||
autoClose | ||
onComplete={handleComplete} | ||
onClose={handleClose} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AddressPopup; |
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
File renamed without changes.
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,13 @@ | ||
import { deleteMyActivities } from '@/pages/api/myActivities/apimyActivities'; | ||
import { useMutation } from '@tanstack/react-query'; | ||
|
||
export default function useDeleteActivity() { | ||
const deleteMyActivityMutation = useMutation({ | ||
mutationFn: deleteMyActivities, | ||
onSuccess: () => { | ||
window.location.reload(); | ||
}, | ||
}); | ||
|
||
return { deleteMyActivityMutation }; | ||
} |
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,45 @@ | ||
import { useInfiniteQuery } from '@tanstack/react-query'; | ||
import { getMyActivityList } from '@/pages/api/myActivities/apimyActivities'; | ||
import { getMyActivityListResponse } from '@/pages/api/myActivities/apimyActivities.types'; | ||
import { useMemo } from 'react'; | ||
import useLoginState from '../useLoginState'; | ||
|
||
const INITIAL_SIZE = 4; | ||
const REFETCH_SIZE = 1; | ||
|
||
export const useMyActivityList = () => { | ||
const loginState = useLoginState(); | ||
|
||
const { data, fetchNextPage, hasNextPage, isLoading, isFetchingNextPage } = | ||
useInfiniteQuery<getMyActivityListResponse>({ | ||
queryKey: ['myActivityList'], | ||
queryFn: ({ pageParam = undefined }) => { | ||
const size = pageParam === undefined ? INITIAL_SIZE : REFETCH_SIZE; | ||
return getMyActivityList({ | ||
size, | ||
cursorId: pageParam as number | undefined, | ||
}); | ||
}, | ||
getNextPageParam: (lastPage) => { | ||
return lastPage.totalCount === lastPage.activities.length | ||
? undefined | ||
: lastPage.cursorId; | ||
}, | ||
initialPageParam: undefined, | ||
enabled: loginState.isLoggedIn, | ||
}); | ||
|
||
const myActivityList = useMemo(() => { | ||
if (data) { | ||
return data.pages.flatMap((page) => page.activities); | ||
} | ||
}, [data]); | ||
|
||
return { | ||
myActivityList, | ||
fetchNextPage, | ||
hasNextPage, | ||
isLoading, | ||
isFetchingNextPage, | ||
}; | ||
}; |
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.
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.
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.
👩💻👍