Skip to content

Commit

Permalink
[#209]
Browse files Browse the repository at this point in the history
  • Loading branch information
hagus99 committed Jun 30, 2022
1 parent 0bd7c21 commit 517cbaf
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 22 deletions.
6 changes: 3 additions & 3 deletions FrontEnd/rebon-frontend/src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Header() {
<div className="header-wrapper" style={{ backgroundColor: headerState.bgColor, borderBottomColor: headerState.bottomLine }}>
<header>
<Link to="/">
<img src="./image/logo.png" alt="logo" />
<img src="/image/logo.png" alt="logo" />
</Link>
{isLogin ? (
<div className="header-logon">
Expand All @@ -32,7 +32,7 @@ export default function Header() {

<Link to="/mypage" style={{ color: 'inherit', textDecoration: 'none' }}>
<div className="header-logon-icon">
<img src="./image/user.png" alt="user" />
<img src="/image/user.png" alt="user" width="100px" />
{userName}
</div>
</Link>
Expand All @@ -50,4 +50,4 @@ export default function Header() {
</header>
</div>
);
}
}
22 changes: 16 additions & 6 deletions FrontEnd/rebon-frontend/src/pages/Login/LoginButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@ import axios from 'axios';

export default function SNSButtons() {

const googleClientId="66233621795-q2t3h8jvd5qc36n4j6j96ejrclnhu4eq.apps.googleusercontent.com"
const naverClientId=""
const googleClientId="66233621795-q2t3h8jvd5qc36n4j6j96ejrclnhu4eq.apps.googleusercontent.com";
const naverClientId="LMoG83yi5hLpLfCCg1fa";
const kakaoClientId="1c4b166500016e67df420423d02e187b"

const params = new URLSearchParams(window.location.search);

useEffect(() => {
const code = params.get("code");
console.log(code);

if(code != null){
console.log("로그인 후");
axios
.get(`http://34.238.48.93:8080/api/auth/google/login/token?code=${code}`)
.get(`http://3.34.139.61:8080/api/auth/google/login/token?code=${code}`)
.then((response) => {
console.log("로그인 후");
console.log(response);
})
.catch((error) => {
console.log('error');
console.log(error);
});
}
console.log(params.get("code"));
},[]);

const googleLoginHandler = () =>{
Expand All @@ -32,13 +36,19 @@ export default function SNSButtons() {
}

const naverLoginHandler = () =>{
const NAVER_LOGIN_URL = `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=CLIENT_ID&state=STATE_STRING&redirect_uri=CALLBACK_URL`;
const NAVER_LOGIN_URL = `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=LMoG83yi5hLpLfCCg1fa&state=STATE_STRING&redirect_uri=CALLBACK_URL`;
window.location.href = NAVER_LOGIN_URL;
}

const kakaoLoginHandler = () =>{
const KAKAO_LOGIN_URL = `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${kakaoClientId}&redirect_uri=http://localhost:8080/admin`;
window.location.href = KAKAO_LOGIN_URL;
}


return (
<div className="joinBtn-wrapper">
<button className="join-btn naver-btn">
<button className="join-btn naver-btn" onClick={naverLoginHandler}>
<img className="logo-img" alt="naverLogo" src="image/naverLogo.png" />
네이버 간편 가입하기
</button>
Expand Down
19 changes: 9 additions & 10 deletions FrontEnd/rebon-frontend/src/pages/Main/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React,{useState,useEffect} from 'react';
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
Expand All @@ -16,7 +16,6 @@ import axios from 'axios';
import { useLocation } from 'react-router';

function TabPanel(props) {

const { children, value, index, ...other } = props;

return (
Expand Down Expand Up @@ -59,13 +58,13 @@ export default function Main() {
axios
.get('http://34.238.48.93:8080/api/shops?tag=1&category=1&subCategories=5&subCategories=7')
.then((response) => {
console.log("데이터값");
console.log('데이터값');
console.log(response.data);
})
.catch((error) => {
console.log('error');
});
},[]);
}, []);

return (
<div className="main-wrapper">
Expand Down Expand Up @@ -102,17 +101,17 @@ export default function Main() {
<label for="select-04">🍝 양식</label>
</div>
</div>
<div className='main-background'>
<div className="searchTitle">📍 '한동대'식당</div>
<div className="main-background">
<div className="searchTitle">📍{location.state.item.name} 식당</div>

<div className="best-wrapper">
<BestCard/>
<BestCard />
</div>
<Divider />

<div className="mainCard-wrapper">
{/* <div className="mainCard-wrapper">
<MainCard />
</div>
</div> */}
</div>
</TabPanel>

Expand Down Expand Up @@ -151,4 +150,4 @@ export default function Main() {
</Box>
</div>
);
}
}
3 changes: 2 additions & 1 deletion FrontEnd/rebon-frontend/src/styles/detail.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
margin-left: 20%;
width: 60%;
margin-bottom: 10%;
margin-top: -30px;
}
.detail-title-wrapper {
margin-top: 5%;
Expand Down Expand Up @@ -178,4 +179,4 @@
.detail-map-image {
height: 300px;
width: 600px;
}
}
4 changes: 2 additions & 2 deletions FrontEnd/rebon-frontend/src/styles/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}

.header-logon-icon img {
width: 26%;
width: 50%;
padding-right: 6px;
}

Expand All @@ -63,4 +63,4 @@
font-size: 1.1em;
margin-left: 7%;
margin-right: 3%;
}
}
2 changes: 2 additions & 0 deletions FrontEnd/rebon-frontend/src/styles/sns-btn.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@

.naver-btn {
background-color: #00bf18;
color:white;
}

.kakao-btn {
background-color: #fae300;
color:white;
}

.google-btn {
Expand Down

0 comments on commit 517cbaf

Please sign in to comment.