-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Weekly11' of https://github.com/kakao-tech-campus-2nd-s…
…tep3/Team9_FE into feat/#108-api
- Loading branch information
Showing
18 changed files
with
168 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
const QUERY_KEYS = { | ||
LOGIN: 'login', | ||
FEED: 'feed', | ||
FOLLOW_LIST: 'followList', | ||
USER_INFO: 'userInfo', | ||
|
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,39 @@ | ||
// import { useQuery } from '@tanstack/react-query'; | ||
import { isAxiosError } from 'axios'; | ||
|
||
import type { UserType } from '@/types'; | ||
import fetchInstance from '../fetchInstance'; | ||
// import QUERY_KEYS from '../queryKeys'; | ||
|
||
type UserTypeResponse = { role: string; userType: UserType }; | ||
|
||
async function getUserType(): Promise<UserTypeResponse> { | ||
try { | ||
const response = await fetchInstance().get('/users/type'); | ||
|
||
return response.data.data; | ||
} catch (error) { | ||
if (isAxiosError(error)) { | ||
if (error.response) { | ||
throw new Error(error.response.data.message || 'user type 가져오기 실패'); | ||
} else { | ||
throw new Error('네트워크 오류 또는 서버에 연결할 수 없습니다.'); | ||
} | ||
} else { | ||
throw new Error('알 수 없는 오류입니다.'); | ||
} | ||
} | ||
} | ||
|
||
// const useGetFollow = () => { | ||
// const { data, status, refetch } = useQuery<APIResponse<FollowResponse>, Error>({ | ||
// queryKey: [QUERY_KEYS.FOLLOW_LIST], | ||
// queryFn: getFollow, | ||
// }); | ||
|
||
// return { data, status, refetch }; | ||
// }; | ||
|
||
// export default useGetFollow; | ||
|
||
export default getUserType; |
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,31 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import KakaoSymbol from '@/assets/kakao-symbol.svg?react'; | ||
|
||
type KakaoLoginButtonProps = { | ||
onClick: () => void; | ||
}; | ||
|
||
const KakaoLoginButton = ({ onClick }: KakaoLoginButtonProps) => { | ||
return ( | ||
<StyledKakaoLoginButton onClick={onClick}> | ||
<KakaoSymbol /> | ||
카카오로 시작하기 | ||
</StyledKakaoLoginButton> | ||
); | ||
}; | ||
|
||
export default KakaoLoginButton; | ||
|
||
const StyledKakaoLoginButton = styled.button` | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin: 0 16px; | ||
padding: 10px 50px; | ||
background-color: var(--color-yellow-kakao); | ||
border-radius: var(--border-radius); | ||
gap: 16px; | ||
font-size: var(--font-size-md); | ||
font-weight: 500; | ||
`; |
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
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.