Skip to content

Commit

Permalink
Merge pull request #2 from SW-Palindrome/feature/initial-route
Browse files Browse the repository at this point in the history
라우터 적용
  • Loading branch information
milkbottle0305 authored Jan 25, 2024
2 parents 9178e56 + c53ee28 commit 16973a7
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 19 deletions.
39 changes: 39 additions & 0 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.3",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
31 changes: 14 additions & 17 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import logo from "./logo.svg";
import { Routes, Route } from "react-router-dom";
import "./App.css";

import Home from "./pages/Home/Home";
import Splash from "./pages/Splash/Splash";
import Calendar from "./pages/Calendar/Calendar";
import Mystudy from "./pages/Mystudy/Mystudy";
import Settings from "./pages/Settings/Settings";

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
learn react
</a>
</header>
</div>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/splash" element={<Splash />} />
<Route path="/calendar" element={<Calendar />} />
<Route path="/mystudy" element={<Mystudy />} />
<Route path="/settings" element={<Settings />} />
</Routes>
);
}

Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import { BrowserRouter } from "react-router-dom";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
//<React.StrictMode>
<BrowserRouter>
<App />
</React.StrictMode>,
</BrowserRouter>,
//</React.StrictMode>,
);

// If you want to start measuring performance in your app, pass a function
Expand Down
9 changes: 9 additions & 0 deletions src/pages/calendar/calendar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Calendar() {
return (
<div>
<h1>Calendar</h1>
</div>
);
}

export default Calendar;
9 changes: 9 additions & 0 deletions src/pages/home/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Home() {
return (
<div>
<h1>Home</h1>
</div>
);
}

export default Home;
9 changes: 9 additions & 0 deletions src/pages/mystudy/mystudy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Mystudy() {
return (
<div>
<h1>Mystudy</h1>
</div>
);
}

export default Mystudy;
9 changes: 9 additions & 0 deletions src/pages/settings/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Settings() {
return (
<div>
<h1>Settings</h1>
</div>
);
}

export default Settings;
9 changes: 9 additions & 0 deletions src/pages/splash/splash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Splash() {
return (
<div>
<h1>Splash</h1>
</div>
);
}

export default Splash;

0 comments on commit 16973a7

Please sign in to comment.