Skip to content

Commit

Permalink
라우팅
Browse files Browse the repository at this point in the history
  • Loading branch information
seacrab808 committed Aug 4, 2024
1 parent 99f4ec0 commit 8dfad9b
Show file tree
Hide file tree
Showing 18 changed files with 336 additions and 18 deletions.
173 changes: 173 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"firebase": "^10.12.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.12",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
18 changes: 17 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
import { Route, Routes } from "react-router-dom";
import DashBoard from "./components/layout/DashBoard";
import SignInPage from "./pages/Auth/SignInPage";
import LoginPage from "./pages/Auth/LoginPage";
import LandingPage from "./pages/Home/LandingPage";

function App() {
return <div className="container">하이</div>;
return (
<Routes>
<Route element={<DashBoard />}>
<Route index element={<LandingPage />} />
<Route path="auth">
<Route path="signIn" element={<LoginPage />} />
<Route path="signIn" element={<SignInPage />} />
</Route>
</Route>
</Routes>
);
}

export default App;
7 changes: 7 additions & 0 deletions src/components/Create/Create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const Create = () => {
return <div>새 일기 만드는 페이지</div>;
};

export default Create;
7 changes: 7 additions & 0 deletions src/components/Drawing/Drawing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const Drawing = () => {
return <div>그림 캔버스 api</div>;
};

export default Drawing;
7 changes: 7 additions & 0 deletions src/components/auth/Login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const Login = () => {
return <div>로그인</div>;
};

export default Login;
7 changes: 7 additions & 0 deletions src/components/auth/SignIn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const SignIn = () => {
return <div>회원가입</div>;
};

export default SignIn;
13 changes: 13 additions & 0 deletions src/components/layout/DashBoard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import { Outlet } from "react-router-dom";
import Container from "./style";

const DashBoard = () => {
return (
<Container>
<Outlet />
</Container>
);
};

export default DashBoard;
7 changes: 7 additions & 0 deletions src/components/layout/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const Home = () => {
return <div>홈페이지</div>;
};

export default Home;
19 changes: 19 additions & 0 deletions src/components/layout/style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import styled from "styled-components";

const Container = styled.div`
display: flex;
flex-direction: column;
position: relative;
width: 360px;
min-height: 100vh;
background-color: #fff;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04);
@media screen and (max-width: 480px) {
width: 100%;
}
`;

export default Container;
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import ReactDOM from "react-dom/client";
import App from "./App";
import "./reset.css";
import "./style.css";
import { BrowserRouter as Router } from "react-router-dom";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
<Router>
<App />
</Router>
</React.StrictMode>
);
13 changes: 13 additions & 0 deletions src/pages/Auth/LoginPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Container from "../../components/layout/style";
import Login from "../../components/auth/Login";

const LoginPage = () => {
return (
<Container>
<Login />
</Container>
);
};

export default LoginPage;
13 changes: 13 additions & 0 deletions src/pages/Auth/SignInPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Container from "../../components/layout/style";
import SignIn from "../../components/auth/SignIn";

const SignInPage = () => {
return (
<Container>
<SignIn />
</Container>
);
};

export default SignInPage;
Loading

0 comments on commit 8dfad9b

Please sign in to comment.