-
Notifications
You must be signed in to change notification settings - Fork 0
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 #102 from boostcampwm2023/99-로그인-페이지-구현
[#99] 로그인 페이지 구현
- Loading branch information
Showing
6 changed files
with
72 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { css } from '@style/css'; | ||
|
||
interface Props { | ||
onClickLogin: () => void; | ||
} | ||
|
||
export default function Login({ onClickLogin }: Props) { | ||
return ( | ||
<section className={loginWrapperStyle}> | ||
<header className={loginHeaderStyle}>Algo With Me</header> | ||
<button onClick={onClickLogin}>Github으로 로그인</button> | ||
</section> | ||
); | ||
} | ||
|
||
const loginWrapperStyle = css({ | ||
border: '1px solid white', | ||
borderRadius: '10px', | ||
width: '100%', | ||
height: '100%', | ||
maxWidth: '500px', | ||
maxHeight: '200px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
}); | ||
|
||
const loginHeaderStyle = css({ | ||
fontSize: '3rem', | ||
fontWeight: 'bold', | ||
textAlign: 'center', | ||
padding: '1rem', | ||
}); |
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 Login from '@/components/Login'; | ||
|
||
const GITHUB_AUTH_URL = 'http://101.101.208.240:3000/auths/github'; | ||
|
||
export default function LoginPage() { | ||
// 넘겨주는 함수는 handle, 함수를 넘길 때의 프로펄티 네임은 on | ||
const handleLogin = () => { | ||
try { | ||
window.location.href = GITHUB_AUTH_URL; | ||
} catch (e) { | ||
const error = e as Error; | ||
console.error(error.message); | ||
} | ||
}; | ||
|
||
return <Login onClickLogin={handleLogin} />; | ||
} |
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