-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 이벤트 생성에서 반복적으로 사용되는 타입 선언 * refactor: 반복되는 path를 상수로 만들고 이를 재사용함 * feat: 게스트 행사, 회원 행사 생성을 위한 api 연결 함수 구현 * feat: 유저 이름이 올바르지 않을 때 보여줄 에러 메세지 수정 * refactor: 이미 제작된 이름 유효성 검증 로직을 재사용하도록 수정 * feat: 행사 생성 시 관리자 이름을 입력받는 페이지 구현 * feat: 회원 이벤트 생성 과정 퍼널 구현 * refactor: 불필요한 조건문 제거 * feat: 비회원 행사 생성 페이지, 회원 행사 생성 페이지를 라우터에 연결 * refactor: 행사 생성시 사용되는 타입으로 재사용하도록 수정 * feat: 회원 이벤트 생성을 트래킹할 amplitude 함수 구현 * feat: 회원 이벤트 생성 시 행사명만 받으면 바로 행사를 생성하는 플로우로 스텝 페이지 구현 * chore: 행사 생성 과정이 회원 여부로 분기됨에 따라 위치와 파일명 수정 * feat: 행사 생성 시 행사 관리자의 이름을 입력받는 스텝 페이지에서 사용하는 이름 검증 훅 구현 * chore: 행사 생성에 대한 path 경로를 수정 * chore: 사용하지 않게된 파일 제거 * test: 분리 개발로 인해 테스트 수행 불가하므로 테스트코드 주석처리 * rename: nickName -> nickname으로 수정 * feat: 사용하지 않는 return 함수 제거 * feat: 회원 이벤트 생성 완료 버튼을 누를 때 로딩이 되도록 함 * rename: submit->onSubmit으로 form태그에서 사용되는 핸들러이름과 일치시킴 * feat: 행사 생성 시 입력받는 관리자 이름, 비밀번호 스텝 페이지의 문구 변경 * rename: Page -> Step으로 이름 변경 * feat: api에서 사용되는 타입을 serviceType으로 이동 * rename: NickName -> Nickname으로 수정
- Loading branch information
1 parent
839fe4e
commit 07401c0
Showing
25 changed files
with
415 additions
and
174 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
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
const EVENT = '/event'; | ||
const EVENT_WITH_EVENT_ID = `${EVENT}/:eventId`; | ||
|
||
export const ROUTER_URLS = { | ||
main: '/', | ||
createEvent: '/event/create', | ||
event: '/event', | ||
eventManage: '/event/:eventId/admin', | ||
home: '/event/:eventId/home', | ||
member: '/event/:eventId/admin/member', | ||
addBill: '/event/:eventId/admin/add-bill', | ||
editBill: '/event/:eventId/admin/edit-bill', | ||
eventEdit: 'event/:eventId/admin/edit', | ||
images: '/event/:eventId/images', | ||
addImages: '/event/:eventId/admin/add-images', | ||
send: 'event/:eventId/:memberId/send', | ||
qrCode: 'event/:eventId/qrcode', | ||
createGuestEvent: `${EVENT}/create/guest`, | ||
createMemberEvent: `${EVENT}/create/member`, | ||
eventManage: `${EVENT_WITH_EVENT_ID}/admin`, | ||
home: `${EVENT_WITH_EVENT_ID}/home`, | ||
member: `${EVENT_WITH_EVENT_ID}/admin/member`, | ||
addBill: `${EVENT_WITH_EVENT_ID}/admin/add-bill`, | ||
editBill: `${EVENT_WITH_EVENT_ID}/admin/edit-bill`, | ||
eventEdit: `${EVENT_WITH_EVENT_ID}/admin/edit`, | ||
images: `${EVENT_WITH_EVENT_ID}/images`, | ||
addImages: `${EVENT_WITH_EVENT_ID}/admin/add-images`, | ||
send: `${EVENT_WITH_EVENT_ID}/:memberId/send`, | ||
qrCode: `${EVENT_WITH_EVENT_ID}/qrcode`, | ||
event: EVENT, | ||
login: '/login', | ||
}; |
7 changes: 5 additions & 2 deletions
7
client/src/hooks/useCreateEventData.tsx → ...s/createEvent/useCreateGuestEventData.tsx
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import {useState} from 'react'; | ||
|
||
import useSetEventNameStep from './useSetEventNameStep'; | ||
import {useSetNickNameStep} from './useSetNicknameStep'; | ||
|
||
// 행사 생성 페이지에서 여러 스텝에 걸쳐 사용되는 상태를 선언해 내려주는 용도의 훅입니다. | ||
const useCreateEventData = () => { | ||
const useCreateGuestEventData = () => { | ||
const eventNameProps = useSetEventNameStep(); | ||
const nickNameProps = useSetNickNameStep(); | ||
const [eventToken, setEventToken] = useState(''); | ||
|
||
return { | ||
eventNameProps, | ||
nickNameProps, | ||
eventToken, | ||
setEventToken, | ||
}; | ||
}; | ||
|
||
export default useCreateEventData; | ||
export default useCreateGuestEventData; |
File renamed without changes.
38 changes: 16 additions & 22 deletions
38
client/src/hooks/useSetEventPasswordStep.ts → ...ks/createEvent/useSetEventPasswordStep.ts
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,29 @@ | ||
import {useState} from 'react'; | ||
|
||
import validateMemberName from '@utils/validate/validateMemberName'; | ||
import {Nickname} from 'types/serviceType'; | ||
|
||
type UseSetNicknameStepProps = ReturnType<typeof useSetNicknameStep>; | ||
|
||
const useSetNicknameStep = () => { | ||
const [nickname, setNickname] = useState<Nickname>(''); | ||
const [errorMessage, setErrorMessage] = useState<string | null>(null); | ||
const [canSubmit, setCanSubmit] = useState(false); | ||
|
||
const handleNicknameChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const name = event.target.value; | ||
const {isValid, errorMessage: errorMessageResult} = validateMemberName(name); | ||
|
||
setErrorMessage(errorMessageResult); | ||
|
||
if (isValid) { | ||
setNickname(name); | ||
} | ||
|
||
setCanSubmit(name.length !== 0); | ||
}; | ||
|
||
return {handleNicknameChange, canSubmit, nickname, errorMessage}; | ||
}; | ||
|
||
export {useSetNicknameStep, type UseSetNicknameStepProps}; |
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
24 changes: 24 additions & 0 deletions
24
client/src/hooks/queries/event/useRequestPostMemberEvent.ts
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,24 @@ | ||
import {useMutation, useQueryClient} from '@tanstack/react-query'; | ||
|
||
import {requestPostMemberEvent} from '@apis/request/event'; | ||
import {EventName} from 'types/serviceType'; | ||
|
||
const useRequestPostMemberEvent = () => { | ||
const queryClient = useQueryClient(); | ||
|
||
const {mutateAsync, ...rest} = useMutation({ | ||
mutationFn: (eventName: EventName) => requestPostMemberEvent(eventName), | ||
onSuccess: () => { | ||
queryClient.removeQueries(); | ||
}, | ||
}); | ||
|
||
// 실행 순서를 await으로 보장하기 위해 mutateAsync 사용 | ||
return { | ||
postEvent: mutateAsync, | ||
isPostEventPending: rest.isPending, | ||
...rest, | ||
}; | ||
}; | ||
|
||
export default useRequestPostMemberEvent; |
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.