-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from kakao-tech-campus-2nd-step3/fix-login-error
Fix: window location으로 리다이렉트
- Loading branch information
Showing
2 changed files
with
19 additions
and
19 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 |
---|---|---|
@@ -1,28 +1,29 @@ | ||
import { Link } from 'react-router-dom' | ||
|
||
import { Flex, Image, Text } from '@chakra-ui/react' | ||
|
||
import KakaoSymbol from '@/assets/kakao-logo-symbol.svg' | ||
|
||
export const KakaoLoginButton = () => { | ||
const redirectURL = import.meta.env.DEV ? import.meta.env.VITE_LOGIN_URL : '' | ||
|
||
const handleLogin = () => { | ||
window.location.href = `${redirectURL}/api/user/login` | ||
} | ||
|
||
return ( | ||
<Link to={`${redirectURL}/api/user/login`}> | ||
<Flex | ||
background="kakao" | ||
rounded="6px" | ||
justifyContent="center" | ||
alignItems="center" | ||
height={10} | ||
gap={3} | ||
_hover={{ cursor: 'pointer' }} | ||
> | ||
<Image src={KakaoSymbol} width={5} /> | ||
<Text fontSize="14px" fontWeight="bold" color="rgba(0, 0, 0, 0.85)"> | ||
카카오 로그인 | ||
</Text> | ||
</Flex> | ||
</Link> | ||
<Flex | ||
background="kakao" | ||
rounded="6px" | ||
justifyContent="center" | ||
alignItems="center" | ||
height={10} | ||
gap={3} | ||
_hover={{ cursor: 'pointer' }} | ||
onClick={handleLogin} | ||
> | ||
<Image src={KakaoSymbol} width={5} /> | ||
<Text fontSize="14px" fontWeight="bold" color="rgba(0, 0, 0, 0.85)"> | ||
카카오 로그인 | ||
</Text> | ||
</Flex> | ||
) | ||
} |
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