-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
김지수
committed
Jan 27, 2022
1 parent
2c11cc4
commit 38716bc
Showing
36 changed files
with
36,552 additions
and
51 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
/build | ||
|
||
# misc | ||
.env | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,51 @@ | ||
import styled, { css } from 'styled-components'; | ||
import { darken, lighten } from 'polished'; | ||
|
||
|
||
const colorStyles = css` | ||
${({ theme, color }) => { | ||
const selected = theme.palette[color]; | ||
return css` | ||
background: ${selected}; | ||
${props => | ||
props.outline && | ||
css` | ||
color: ${selected}; | ||
background: none; | ||
border: 2px solid ${selected}; | ||
` | ||
} | ||
`; | ||
}} | ||
`; | ||
|
||
const StyledButton = styled.button` | ||
background: transparent; | ||
color: white; | ||
height: 2.125rem; | ||
font-family: var(--font-title); | ||
font-size: 1.125rem; | ||
line-height: 1.7rem; | ||
padding: 0 1.5rem; | ||
border-radius: 1.25rem; | ||
cursor: pointer; | ||
${colorStyles} | ||
`; | ||
|
||
|
||
|
||
|
||
const Button = ({ children, color, outline, ...rest }) => { | ||
return ( | ||
<StyledButton | ||
color={color} | ||
outline={outline} | ||
{...rest} | ||
> | ||
{children} | ||
</StyledButton> | ||
); | ||
} | ||
|
||
export default Button; |
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,48 @@ | ||
import { useState, useEffect } from 'react'; | ||
import LoginPopUp from '../components/LoginPopUp'; | ||
import { | ||
HeaderWrapper, | ||
Logo, | ||
UserMenuWrapper, | ||
UserIcon, | ||
LoginBtn | ||
} from '../styles/Header' | ||
|
||
const Header = () => { | ||
const [isLogin, setIsLogin] = useState(false); | ||
const [isLoginPopUp, setIsLoginPopUp] = useState(false); | ||
|
||
const onToggleLogin = () => { | ||
if (isLogin == true) { | ||
setIsLogin(false); | ||
} | ||
else if (isLogin === false) { | ||
setIsLogin(true); | ||
} | ||
} | ||
|
||
return ( | ||
<> | ||
<HeaderWrapper> | ||
<Logo>Devoard</Logo> | ||
<UserMenuWrapper> | ||
<UserIcon /> | ||
<LoginBtn | ||
color='orange' | ||
outline | ||
onClick={()=>{setIsLoginPopUp(true)}} | ||
> | ||
로그인 | ||
</LoginBtn> | ||
</UserMenuWrapper> | ||
</HeaderWrapper> | ||
<LoginPopUp | ||
isVisible={isLoginPopUp} | ||
setIsLoginPopUp={setIsLoginPopUp} | ||
> | ||
</LoginPopUp> | ||
</> | ||
); | ||
} | ||
|
||
export default Header; |
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,119 @@ | ||
import styled from "styled-components"; | ||
import GoogleLogin from 'react-google-login' | ||
import githubIcon from '../assets/images/githubIcon.png'; | ||
import googleIcon from '../assets/images/googleIcon.png'; | ||
import { IoIosClose } from 'react-icons/io'; | ||
|
||
const PopUpBackground = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: fixed; | ||
z-index: 1; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
overflow: auto; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
`; | ||
|
||
const PopUpWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 80%; | ||
height: 400px; | ||
background: white; | ||
border-radius: 0.7rem; | ||
position: relative; | ||
.icon { | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
const IconWrapper = styled.div``; | ||
|
||
const Icon = styled.img` | ||
width: 4rem; | ||
height: 4rem; | ||
margin: 0 2rem; | ||
border-radius: 1px solid gray; | ||
cursor: pointer; | ||
`; | ||
|
||
const GithubLink = styled.a``; | ||
|
||
const GithubIcon = styled(Icon).attrs({ | ||
src: `${githubIcon}` | ||
})``; | ||
|
||
|
||
|
||
const onSuccess = async(res) => { | ||
console.log(res); | ||
} | ||
|
||
const onFailure = (err) => { | ||
console.log(err); | ||
} | ||
|
||
const LoginPopUp = ({ isVisible, setIsLoginPopUp }) => { | ||
if (!isVisible) return null; | ||
|
||
|
||
return ( | ||
<PopUpBackground> | ||
<PopUpWrapper> | ||
<IoIosClose | ||
className="icon" | ||
size="40" | ||
onClick={()=>{setIsLoginPopUp(false)}} | ||
/> | ||
<IconWrapper> | ||
<GoogleLogin | ||
render={ renderProps => ( | ||
<button | ||
onClick={renderProps.onClick} | ||
disabled={renderProps.disabled} | ||
style={{ | ||
background: 'none', | ||
outline: 'none', | ||
border: 'none', | ||
cursor: 'pointer' | ||
}} | ||
> | ||
<img | ||
src={googleIcon} | ||
alt="google login icon" | ||
style={{ | ||
width: "4rem", | ||
height: "4rem", | ||
borderRadius: "50%", | ||
}} | ||
/> | ||
</button> | ||
)} | ||
clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID} | ||
responseType={"id_token"} | ||
onSuccess={onSuccess} | ||
onFailure={onFailure} | ||
/> | ||
<GithubLink | ||
href={`https://github.com/login/oauth/authorize?client_id=${process.env.REACT_APP_GITHUB_CLIENT_ID}&redirect_uri=https://localhost:3000`} | ||
> | ||
<GithubIcon /> | ||
</GithubLink> | ||
|
||
</IconWrapper> | ||
</PopUpWrapper> | ||
</PopUpBackground> | ||
|
||
); | ||
} | ||
|
||
export default LoginPopUp; |
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,13 +1,64 @@ | ||
@import | ||
url('https://cdn.rawgit.com/moonspam/NanumSquare/master/nanumsquare.css'); | ||
|
||
@font-face { | ||
font-family: 'SpoqaHanSansNeo-Regular'; | ||
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/SpoqaHanSansNeo-Regular.woff') format('woff'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: 'yg-jalnan'; | ||
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/JalnanOTF00.woff') format('woff'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
|
||
|
||
@media (min-width: 1920px) { | ||
body {width: 1680px;} | ||
} | ||
|
||
@media (max-width: 1919px) { | ||
body {width: 1420px;} | ||
} | ||
|
||
@media (max-width: 1400px) { | ||
body { | ||
width: 1024px; | ||
} | ||
} | ||
|
||
|
||
:root { | ||
--font-body: 'NanumSquare'; | ||
--font-title: 'SpoqaHanSansNeo-Regular'; | ||
--font-logo: 'yg-jalnan'; | ||
} | ||
|
||
|
||
html { | ||
background: #080e1d; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
padding: 0px 20px; | ||
font-family: var(--font-body); | ||
font-size: 16px; | ||
line-height: 1.5rem; | ||
color: #3A3D3E; | ||
-ms-overflow-style: none; | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} | ||
|
||
::-webkit-scrollbar { display: none; } | ||
|
||
.title { | ||
font-family: var(--font-title); | ||
font-size: 30px; | ||
} |
Oops, something went wrong.