-
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.
Browse files
Browse the repository at this point in the history
AppBar Component 개발
- Loading branch information
Showing
9 changed files
with
3,087 additions
and
2,452 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,14 @@ | ||
import { DefaultLayout } from "@/layout/DefaultLayout"; | ||
import SocialLoginButton from "@/component/button/SocialLoginButton"; | ||
import { kakaoLogin } from "./kakao/kakaoLogin"; | ||
import { googleLogin } from "./google/googleLogin"; | ||
|
||
const Login = () => { | ||
return ( | ||
<DefaultLayout appBarVisible={false}> | ||
<SocialLoginButton type="kakao" handler={kakaoLogin} /> | ||
<SocialLoginButton type="google" handler={googleLogin} /> | ||
</DefaultLayout> | ||
); | ||
}; | ||
export default Login; |
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,3 @@ | ||
export function googleLogin() { | ||
console.log("구글 로그인 시도"); | ||
} |
File renamed without changes.
18 changes: 3 additions & 15 deletions
18
src/app/login/KakaoLogin.tsx → src/app/login/kakao/kakaoLogin.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,18 +1,6 @@ | ||
const Login = () => { | ||
export function kakaoLogin() { | ||
const REST_API_KEY: string = import.meta.env.VITE_REST_API_KEY; | ||
const REDIRECT_URI: string = import.meta.env.VITE_REDIRECT_URI; | ||
const link = `https://kauth.kakao.com/oauth/authorize?client_id=${REST_API_KEY}&redirect_uri=${REDIRECT_URI}&response_type=code`; | ||
|
||
const loginHandler = () => { | ||
window.location.href = link; | ||
}; | ||
|
||
return ( | ||
<div> | ||
<button type="button" onClick={loginHandler}> | ||
Hello Kakao Login | ||
</button> | ||
</div> | ||
); | ||
}; | ||
export default Login; | ||
window.location.href = link; | ||
} |
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,68 @@ | ||
import { css } from "@emotion/react"; | ||
import { useNavigate } from "react-router-dom"; | ||
import Icon from "../Icon/Icon"; | ||
|
||
export type AppBarProps = { | ||
title?: string; | ||
LeftComp?: React.ReactNode; | ||
RightComp?: React.ReactNode; | ||
}; | ||
|
||
//FIXME: 색깔 디자인 토큰에 따라 변경 | ||
const Back = () => { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<Icon | ||
icon="ic_back" | ||
onClick={() => { | ||
navigate(-1); | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
//FIXME : 디자인 토큰에 따라 색깔 변경, 폰트 수정 | ||
const AppBar = ({ title, LeftComp = <Back />, RightComp = <div></div> }: AppBarProps) => { | ||
return ( | ||
<> | ||
<div | ||
css={css` | ||
width: 100%; | ||
max-width: 48rem; | ||
height: 4.8rem; | ||
padding: 0 2rem; | ||
background-color: transparent; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
position: fixed; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
box-sizing: border-box; | ||
`} | ||
> | ||
{LeftComp} | ||
<div | ||
css={css` | ||
position: absolute; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
font-size: 1.8rem; | ||
`} | ||
> | ||
{title} | ||
</div> | ||
{RightComp} | ||
</div> | ||
<div | ||
css={css` | ||
width: 100%; | ||
height: 4.8rem; | ||
`} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default AppBar; |
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