-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
다락방 api를 페이지에 연결
- Loading branch information
Showing
31 changed files
with
547 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ dist | |
.env | ||
.env* | ||
coverage | ||
|
||
public/firebaseConfig.js |
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
14 changes: 12 additions & 2 deletions
14
frontend/src/components/OptionsPanel/OptionsPanel.style.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
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,17 @@ | ||
import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
|
||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { postDarakbang } from '@_apis/posts'; | ||
|
||
export default function useCreateDarakbang(onSuccess?: () => void) { | ||
const queryClient = useQueryClient(); | ||
|
||
return useMutation({ | ||
mutationFn: postDarakbang, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.myDarakbangs] }); | ||
|
||
if (onSuccess) onSuccess(); | ||
}, | ||
}); | ||
} |
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,32 @@ | ||
import { useMutation, useQueryClient } from '@tanstack/react-query'; | ||
|
||
import { ApiError } from '@_utils/customError/ApiError'; | ||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { postDarakbangEntrance } from '@_apis/posts'; | ||
|
||
export default function useEnterDarakbang({ | ||
onSuccess, | ||
onError, | ||
}: { | ||
onSuccess?: () => void; | ||
onError: (string: string) => void; | ||
}) { | ||
const queryClient = useQueryClient(); | ||
|
||
return useMutation({ | ||
mutationFn: ({ code, nickname }: { code: string; nickname: string }) => | ||
postDarakbangEntrance({ code, nickname }), | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.myDarakbangs] }); | ||
|
||
if (onSuccess) onSuccess(); | ||
}, | ||
|
||
onError: (err) => { | ||
if (err instanceof ApiError) { | ||
onError(err.message); | ||
} | ||
throw err; | ||
}, | ||
}); | ||
} |
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,12 @@ | ||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { getDarakbangInviteCode } from '@_apis/gets'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export default function useDarakbangInviteCode(darakbangId: number) { | ||
const { data: inviteCode, isLoading } = useQuery({ | ||
queryKey: [QUERY_KEYS.darakbangInviteCode, darakbangId], | ||
queryFn: () => getDarakbangInviteCode(darakbangId), | ||
}); | ||
|
||
return { inviteCode, isLoading }; | ||
} |
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,12 @@ | ||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { getDarakbangMembers } from '@_apis/gets'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export default function useDarakbangMembers(darakbangId: number) { | ||
const { data: members, isLoading } = useQuery({ | ||
queryKey: [QUERY_KEYS.darakbangMembers, darakbangId], | ||
queryFn: () => getDarakbangMembers(darakbangId), | ||
}); | ||
|
||
return { members, isLoading }; | ||
} |
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,12 @@ | ||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { getDarakbangNameByCode } from '@_apis/gets'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export default function useDarakbangNameByCode(code: string) { | ||
const { data: darakbangName, isLoading } = useQuery({ | ||
queryKey: [QUERY_KEYS.darakbangNameByCode, code], | ||
queryFn: () => getDarakbangNameByCode(code), | ||
}); | ||
|
||
return { darakbangName, isLoading }; | ||
} |
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,12 @@ | ||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { getMyDarakbangs } from '@_apis/gets'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export default function useMyDarakbangs() { | ||
const { data: myDarakbangs, isLoading } = useQuery({ | ||
queryKey: [QUERY_KEYS.myDarakbangs], | ||
queryFn: getMyDarakbangs, | ||
}); | ||
|
||
return { myDarakbangs, isLoading }; | ||
} |
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,12 @@ | ||
import QUERY_KEYS from '@_constants/queryKeys'; | ||
import { getMyRoleInDarakbang } from './../../apis/gets'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export default function useMyRoleInDarakbang(darakbangId: number) { | ||
const { data: myRoleInDarakbang, isLoading } = useQuery({ | ||
queryKey: [QUERY_KEYS.myRoleInDarakbang, darakbangId], | ||
queryFn: () => getMyRoleInDarakbang(darakbangId), | ||
}); | ||
|
||
return { myRoleInDarakbang, isLoading }; | ||
} |
3 changes: 1 addition & 2 deletions
3
frontend/src/layouts/CompleteLayout/CompleteBottomWrapper/CompleteBottomWrapper.style.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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { DISPLAY_MAX_WIDTH } from '@_constants/styles'; | ||
import { css } from '@emotion/react'; | ||
|
||
// TODO: 바텀 버튼 UI에 대한 기획 논의 필요 | ||
export const bottomFixedStyle = css` | ||
position: fixed; | ||
bottom: 26px; | ||
width: ${DISPLAY_MAX_WIDTH}; | ||
width: 100%; | ||
padding: 0 16px; | ||
`; |
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.