From 517cbaf29c2bafcfcde1639dac3facba5a16e5be Mon Sep 17 00:00:00 2001 From: hagus99 Date: Thu, 30 Jun 2022 20:56:28 +0900 Subject: [PATCH] [#209] --- .../src/components/Header/index.js | 6 ++--- .../src/pages/Login/LoginButton/index.js | 22 ++++++++++++++----- .../rebon-frontend/src/pages/Main/index.js | 19 ++++++++-------- FrontEnd/rebon-frontend/src/styles/detail.css | 3 ++- FrontEnd/rebon-frontend/src/styles/header.css | 4 ++-- .../rebon-frontend/src/styles/sns-btn.css | 2 ++ 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/FrontEnd/rebon-frontend/src/components/Header/index.js b/FrontEnd/rebon-frontend/src/components/Header/index.js index 81bea323..ce3edcea 100644 --- a/FrontEnd/rebon-frontend/src/components/Header/index.js +++ b/FrontEnd/rebon-frontend/src/components/Header/index.js @@ -22,7 +22,7 @@ export default function Header() {
- logo + logo {isLogin ? (
@@ -32,7 +32,7 @@ export default function Header() {
- user + user {userName}
@@ -50,4 +50,4 @@ export default function Header() {
); -} +} \ No newline at end of file diff --git a/FrontEnd/rebon-frontend/src/pages/Login/LoginButton/index.js b/FrontEnd/rebon-frontend/src/pages/Login/LoginButton/index.js index 79863a1f..09b114d2 100644 --- a/FrontEnd/rebon-frontend/src/pages/Login/LoginButton/index.js +++ b/FrontEnd/rebon-frontend/src/pages/Login/LoginButton/index.js @@ -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 = () =>{ @@ -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 (
- diff --git a/FrontEnd/rebon-frontend/src/pages/Main/index.js b/FrontEnd/rebon-frontend/src/pages/Main/index.js index 06af4852..699293e8 100644 --- a/FrontEnd/rebon-frontend/src/pages/Main/index.js +++ b/FrontEnd/rebon-frontend/src/pages/Main/index.js @@ -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'; @@ -16,7 +16,6 @@ import axios from 'axios'; import { useLocation } from 'react-router'; function TabPanel(props) { - const { children, value, index, ...other } = props; return ( @@ -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 (
@@ -102,17 +101,17 @@ export default function Main() {
-
-
📍 '한동대'식당
+
+
📍{location.state.item.name} 식당
- +
-
+ {/*
-
+
*/}
@@ -151,4 +150,4 @@ export default function Main() {
); -} +} \ No newline at end of file diff --git a/FrontEnd/rebon-frontend/src/styles/detail.css b/FrontEnd/rebon-frontend/src/styles/detail.css index a29a227a..24a2b1d2 100644 --- a/FrontEnd/rebon-frontend/src/styles/detail.css +++ b/FrontEnd/rebon-frontend/src/styles/detail.css @@ -32,6 +32,7 @@ margin-left: 20%; width: 60%; margin-bottom: 10%; + margin-top: -30px; } .detail-title-wrapper { margin-top: 5%; @@ -178,4 +179,4 @@ .detail-map-image { height: 300px; width: 600px; -} +} \ No newline at end of file diff --git a/FrontEnd/rebon-frontend/src/styles/header.css b/FrontEnd/rebon-frontend/src/styles/header.css index 329f57d2..120c749d 100644 --- a/FrontEnd/rebon-frontend/src/styles/header.css +++ b/FrontEnd/rebon-frontend/src/styles/header.css @@ -42,7 +42,7 @@ } .header-logon-icon img { - width: 26%; + width: 50%; padding-right: 6px; } @@ -63,4 +63,4 @@ font-size: 1.1em; margin-left: 7%; margin-right: 3%; -} +} \ No newline at end of file diff --git a/FrontEnd/rebon-frontend/src/styles/sns-btn.css b/FrontEnd/rebon-frontend/src/styles/sns-btn.css index 39f2f120..2dd0fd57 100644 --- a/FrontEnd/rebon-frontend/src/styles/sns-btn.css +++ b/FrontEnd/rebon-frontend/src/styles/sns-btn.css @@ -25,10 +25,12 @@ .naver-btn { background-color: #00bf18; + color:white; } .kakao-btn { background-color: #fae300; + color:white; } .google-btn {