From 195b729c90a0a3ea8728ef89771d5342f3be0409 Mon Sep 17 00:00:00 2001 From: LEE <dlwodyd4529@gmail.com> Date: Wed, 22 Nov 2023 18:50:20 +0900 Subject: [PATCH] Delete Router.js, Modifiy APP.js --- frontend/package-lock.json | 2 +- frontend/package.json | 2 +- frontend/src/App.js | 16 +++++++++++++++- frontend/src/Header.css | 35 +++++++++++++++++++++++++++++++++++ frontend/src/Header.js | 1 + frontend/src/Router.js | 20 -------------------- frontend/src/index.js | 6 +----- 7 files changed, 54 insertions(+), 28 deletions(-) create mode 100644 frontend/src/Header.css delete mode 100644 frontend/src/Router.js diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ae744f3e..7d61652e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -22,7 +22,7 @@ "web-vitals": "^2.1.4" }, "devDependencies": { - "react-scripts": "5.0.1" + "react-scripts": "^5.0.1" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/frontend/package.json b/frontend/package.json index 3b527825..4d6a8031 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,7 +17,7 @@ "web-vitals": "^2.1.4" }, "devDependencies": { - "react-scripts": "5.0.1" + "react-scripts": "^5.0.1" }, "scripts": { "start": "react-scripts start", diff --git a/frontend/src/App.js b/frontend/src/App.js index b43e8d06..75f4ca4b 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,8 +1,22 @@ import "./App.css"; +import {Routes, Route } from 'react-router-dom'; +import Header from "./Header.js"; +import Main from "./Main.js"; import GoogleLoginButton from "./GoogleLoginButton.js"; function App() { - return <GoogleLoginButton/>; + return( + <div className="App"> + <Header/> + <Routes> + <Route path="/" element={<Main/>}></Route> + <Route path="/search" element={<h1>검색</h1>}></Route> + {/* <Route path="/postwrite" element={<PostWrite/>}></Route> */} + </Routes> + <GoogleLoginButton/> + {/* <Footer/> */} + </div> + ); } export default App; \ No newline at end of file diff --git a/frontend/src/Header.css b/frontend/src/Header.css new file mode 100644 index 00000000..14b0bf3a --- /dev/null +++ b/frontend/src/Header.css @@ -0,0 +1,35 @@ +.header { + /* background-color:$white; */ + /* z-index: 999; */ + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + /* height: 70px; */ + border-bottom: 1px solid; + /* overflow: auto */ +} + +.logo_image { + width: 350px; + /* height: ; */ + float: left; + margin-bottom: 10px; +} + +.menu_list{ + display: flex; + flex-direction: row; + padding: 0px; + margin: 0px; + /* margin-left: 500px; */ + float: right; +} + +li{ + /* font-family: '', cursive; */ + list-style-type: none; + margin-right: 3rem; + font-size: 1.2rem; + font-weight: 100; +} \ No newline at end of file diff --git a/frontend/src/Header.js b/frontend/src/Header.js index 7a0ebc4e..f3d61773 100644 --- a/frontend/src/Header.js +++ b/frontend/src/Header.js @@ -1,5 +1,6 @@ import {Link} from "react-router-dom"; import logo from './logo.png'; +import './Header.css'; function Header(){ return( diff --git a/frontend/src/Router.js b/frontend/src/Router.js deleted file mode 100644 index ff1cafa9..00000000 --- a/frontend/src/Router.js +++ /dev/null @@ -1,20 +0,0 @@ -import { BrowserRouter, Routes, Route } from 'react-router-dom'; -import Main from './Main.js'; - -function Router() { - return ( - <div className="Router"> - <BrowserRouter> - {/* <Header/> */} - <Routes> - <Route path="/" element={<Main/>}></Route> - {/* <Route path="/search" element={<Search/>}></Route> */} - {/* <Route path="/postwrite" element={<PostWrite/>}></Route> */} - </Routes> - {/* <Footer/> */} - </BrowserRouter> - </div> - ); -} - -export default Router; diff --git a/frontend/src/index.js b/frontend/src/index.js index bfae9347..532f33b6 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -3,16 +3,12 @@ import ReactDOM from "react-dom/client"; import { BrowserRouter, Routes, Route } from "react-router-dom"; import "./index.css"; import App from "./App"; -import Main from "./Main"; const root = ReactDOM.createRoot(document.getElementById("root")); root.render( <React.StrictMode> <BrowserRouter> - <Routes> - <Route path="/" element={<App />} /> - <Route path="/main" element={<Main />} /> - </Routes> + <App/> </BrowserRouter> </React.StrictMode> ); -- GitLab