Skip to content

Commit

Permalink
[feature]/#6/login
Browse files Browse the repository at this point in the history
서버에서 데이터 받아오기 하려고 햇으나 ... 실패....
  • Loading branch information
aranlll committed May 18, 2024
1 parent 5d33a3c commit 259e9ef
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 31 deletions.
29 changes: 29 additions & 0 deletions client/green__day/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/green__day/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.6.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
Expand Down
38 changes: 12 additions & 26 deletions client/green__day/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import Notice from "./Notice.js";
import History from "./History.js";


import { useState } from "react";
import { useState ,useEffect} from "react";


function App() {
let [buttonOpen,setButtonOpen]=useState(false);
/*let [shouldRenderApp,setShouldRenderApp]=useState(true);*/


const [isModalOpen, setModalOpen] = useState(false);//useState사용하여 상태 초기화 및 모달의 열림/닫힘 상태관리
Expand Down Expand Up @@ -40,14 +41,18 @@ function App() {
// console.error('데이터를 가져오는 중 오류 발생:', error);
// }
// }

/* useEffect(() => {
const path = window.location.pathname;
const excludedPaths = ['/History', '/Notice',"/Home"]; // 제외할 경로들
setShouldRenderApp(!excludedPaths.includes(path));
}, []);
if (!shouldRenderApp) {
return null;
};
*/
return (
<>
<h1>Green Day!</h1>
<h4>Q. 여러분은 평소에 환경을 얼마큼 생각하시나요?<br />
Green Day는 제로-웨이스트 시도 또는 습관을 기르려는 사람들을 위한 공간입니다.</h4>
<title>네이버 로그인</title>
<div className="App">
<div>

<Routes>
Expand All @@ -61,25 +66,6 @@ Green Day는 제로-웨이스트 시도 또는 습관을 기르려는 사람들

</div>


</div>
<button className="tree_image" onClick={()=>{setButtonOpen(true)}}>
<img src='tree.png'a href="APIExamNaverLogin.html" /></button>

{
buttonOpen == true ? <div>
<div className="login_button">
<img src="a.png" />
</div>

<button>
<div className="login_button_content">
<img src='x.png' onClick={()=>{setButtonOpen(false)}}/>
</div>
</button>
</div> : null
}

</>
);
}
Expand Down
18 changes: 13 additions & 5 deletions client/green__day/src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import {Routes, Route,Link, useNavigate} from "react-router-dom";
import Modal from './modiary';
import Notice from "./Notice.js";
import History from "./History.js";

import axios from 'axios';


import { useState } from "react";


function Home() {
let [buttonOpen,setButtonOpen]=useState(false);

// let [userName,setUserName]=useState(userName);


const [isModalOpen, setModalOpen] = useState(false);//useState사용하여 상태 초기화 및 모달의 열림/닫힘 상태관리

Expand Down Expand Up @@ -40,7 +41,7 @@ function Home() {
// console.error('데이터를 가져오는 중 오류 발생:', error);
// }
// }

return (
<>
<h1>Green Day!</h1>
Expand All @@ -50,7 +51,15 @@ Green Day는 제로-웨이스트 시도 또는 습관을 기르려는 사람들
<div className="App">
<div>
<h5>
방문자님,<br />

<div />

{/* <button onClick={()=>{
}}>
{userName.id[0]}
</button> */}
님,<br />
환영합니다.<br /><br />
<div className="one"></div>
</h5>
Expand Down Expand Up @@ -96,5 +105,4 @@ Green Day는 제로-웨이스트 시도 또는 습관을 기르려는 사람들
}



export default Home;
Empty file added client/green__day/src/xlog.js
Empty file.

0 comments on commit 259e9ef

Please sign in to comment.