Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 로그인 페이지 생성 #76

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions frontend/src/component/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
import React from "react";
import {Link} from "react-router-dom";
import {KAKAO_AUTH_URL} from "../auth/OAuth";
import HOME from "../images/home.png";
import POSTS from "../images/posts.png";
import LOCATION from "../images/location.png";
import CHAT from "../images/chat.png";
import PROFILE from "../images/profile.png";
import styles from "../page/style/Navbar.css"

export const NavBar = () => {
return (
<>
<Link to="/post-list">
<button>HOME</button>
<div className={"menu-logo"}>
<Link to="/login">
<img
style={{ width: "1.5rem" }}
src={HOME}/>
<div>홈</div>
</Link>
<Link to="/post-detail">
<button>Item Detail</button>
<Link to="/post-list">
<img
style={{ width: "1.5rem" }}
src={POSTS}/>
<div>동네생활</div>
</Link>
<Link to="/mypage">
<button>My page</button>
<Link to="/location">
<img
style={{ width: "1.5rem" }}
src={LOCATION}/>
<div>내 근처</div>
</Link>
<Link to="/login">
<button>Login page</button>
<Link to="/chat">
<img
style={{ width: "1.5rem" }}
src={CHAT}/>
<div>채팅</div>
</Link>
<Link to="/signup">
<button>Sign Up page</button>
<Link to="/profile">
<img
style={{ width: "1.5rem" }}
src={PROFILE}/>
<div>나의 당근</div>
</Link>
</>
</div>
);
}
Binary file added frontend/src/images/chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/dangn_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/kakao_login_medium_wide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/location.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/posts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/images/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 25 additions & 9 deletions frontend/src/page/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, {useState} from "react";
import {Link, Route} from "react-router-dom";
import axios from "axios";
import {KAKAO_AUTH_URL} from "../auth/OAuth";
import KAKAO_LOGO from "../images/kakao_login_large_wide.png"
import DANGN_LOGO from "../images/dangn_logo.png"
import KAKAO_BUTTON from "../images/kakao_login_medium_wide.png"
import styles from '../App.css';

export const LoginPage = () => {
Expand Down Expand Up @@ -32,15 +33,30 @@ export const LoginPage = () => {

return (
<div>
<h1>Login Page</h1>
<input type={"text"} placeholder={"ID"} onChange={changeId}/><br/>
<input type={"password"} placeholder={"PW"} onChange={changePw}/><br/>
<input type={"button"} onClick={loginSubmit} value={"submit"}/>
<Route>
<Link to={"/signup"}><button>Sign Up</button></Link>
</Route>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<img
style={{ width: "10rem" }}
src={DANGN_LOGO}/>
<h2>당신 근처의 중고책 마켓</h2>
<div>중고 서적 거래</div>
<div>지금 내 대학교를 인증하고 시작해보세요!</div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href={KAKAO_AUTH_URL}>
<img src={KAKAO_LOGO}></img>
<img src={KAKAO_BUTTON}/>
</a>
</div>
)
Expand Down
16 changes: 9 additions & 7 deletions frontend/src/page/RouterPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ export const RouterPage = () => {
return (
<div>
<BrowserRouter>
<NavBar/>

<Switch>
<Route path="/post-list" component={ItemListPage}/>
<Route path="/post-detail" component={ItemDetailPage}/>
<Route path="/mypage" component={MyPage}/>
<Route path="/login" component={LoginPage}/>
<Route path="/post-list" component={ItemListPage}/>
<Route path="/location" component={ItemDetailPage}/>
<Route path="/chat" component={SignUpPage}/>
<Route path="/profile" component={MyPage}/>
<Route path="/oauth2/redirect" component={OAuth2RedirectHandler} />
<Route path="/signup" component={SignUpPage}/>
<Route path="/mypage" component={MyPage}/>
<Redirect path="*" to="/post-list"/>
{/*<Route path="/mypage" component={MyPage}/>*/}
<Redirect path="*" to="/login"/>
</Switch>
<br/>
<NavBar/>
</BrowserRouter>
</div>
)
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/page/style/Navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.menu-logo {
margin: 0rem 0rem 0rem 0.5rem;
display: flex;
vertical-align: middle;
align-items: center;
}
15 changes: 15 additions & 0 deletions frontend/src/page/style/Pages.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.main-page {
background: #ffffff;
font-family: "BauctionMainFont";
color: #141a24;
font-size: 1.2rem;
text-align: center;
min-height: 100vh;
}

.login-page-link {
font-size: 0.8rem;
font-weight: bold;
margin: 0rem 0rem 0rem 21rem !important;
}