-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Chan Lee <[email protected]> Co-authored-by: Minjae Kim <[email protected]> Co-authored-by: 이진욱 <[email protected]>
- Loading branch information
1 parent
781f2fe
commit 97c6850
Showing
187 changed files
with
1,269 additions
and
882 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
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,35 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { axiosInstance } from '@api/axiosInstance'; | ||
|
||
import { useTokenStore } from '@stores/accessToken.store'; | ||
import { useLoginInfoStore } from '@stores/loginInfo.store'; | ||
|
||
export const useAllServicesPage = () => { | ||
const { loginInfo, setLoginInfo } = useLoginInfoStore(); | ||
|
||
const setAccessToken = useTokenStore((state) => state.setAccessToken); | ||
const myId = loginInfo?.id ? String(loginInfo?.id) : null; | ||
|
||
const navigate = useNavigate(); | ||
|
||
const moveToPage = (pathName: string) => { | ||
navigate(pathName); | ||
}; | ||
|
||
const logout = () => { | ||
if (myId) { | ||
axiosInstance.delete('/auth/logout').finally(() => { | ||
setLoginInfo(null); | ||
setAccessToken(null); | ||
location.href = '/'; | ||
}); | ||
} | ||
}; | ||
|
||
return { | ||
moveToPage, | ||
logout, | ||
myId, | ||
}; | ||
}; |
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,10 @@ | ||
import { theme } from '@styles/theme'; | ||
|
||
export const AUTH_PAGE_BUTTON_PROPS = { | ||
width: '100%', | ||
backgroundColor: 'transparent', | ||
fontWeight: 500, | ||
height: '2rem', | ||
textColor: theme.PALETTE.GRAY_400, | ||
borderColor: theme.PALETTE.GRAY_400, | ||
} as const; |
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 { useCallback } from 'react'; | ||
import { useLayoutEffect } from 'react'; | ||
import { FallbackProps } from 'react-error-boundary'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { useQueryClient } from '@tanstack/react-query'; | ||
|
||
import { usePathnameChange } from '@hooks/usePathnameChange'; | ||
|
||
import { useTokenStore } from '@stores/accessToken.store'; | ||
import { useLoginInfoStore } from '@stores/loginInfo.store'; | ||
|
||
import { PATH_NAME } from '@constants/pathName'; | ||
|
||
export const useAuthErrorPage = ( | ||
resetErrorBoundary: FallbackProps['resetErrorBoundary'] | ||
) => { | ||
const setAccessToken = useTokenStore((state) => state.setAccessToken); | ||
const setLoginInfo = useLoginInfoStore((state) => state.setLoginInfo); | ||
|
||
const navigate = useNavigate(); | ||
const queryClient = useQueryClient(); | ||
|
||
const reset = useCallback(() => { | ||
resetErrorBoundary(); | ||
queryClient.clear(); | ||
}, [queryClient, resetErrorBoundary]); | ||
|
||
usePathnameChange(reset); | ||
|
||
useLayoutEffect(() => { | ||
setAccessToken(null); | ||
setLoginInfo(null); | ||
}, [setAccessToken, setLoginInfo]); | ||
|
||
const navigateToLoginPage = () => navigate(PATH_NAME.LOGIN); | ||
const navigateToMainPage = () => navigate(PATH_NAME.MAIN); | ||
|
||
return { navigateToLoginPage, navigateToMainPage }; | ||
}; |
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.