App.tsx 1.58 KB
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
import React from "react";
Yoon, Daeki's avatar
Yoon, Daeki committed
2
import { BrowserRouter, Route, Routes } from "react-router-dom";
Yoon, Daeki's avatar
Yoon, Daeki committed
3
import "tailwindcss/tailwind.css";
Lee Soobeom's avatar
Lee Soobeom committed
4
import { IntoPost } from "./post/intopost";
백승민's avatar
백승민 committed
5
import { Login, Profile, RequireAuth, Signup, Admin, ImgRewrite } from "./auth";
6
import { Header, Body } from "./home";
Lee Soobeom's avatar
Lee Soobeom committed
7
import { Board } from "./board";
8
import Posting from "./post/posting";
Yoon, Daeki's avatar
Yoon, Daeki committed
9
import { Layout } from "./commons";
Lee Soobeom's avatar
Lee Soobeom committed
10
import { EditPost } from "./post/editpost";
Yoon, Daeki's avatar
Yoon, Daeki committed
11
12
13

export const App = () => {
  return (
백승민's avatar
theme1    
백승민 committed
14
15
    <BrowserRouter>
      <Routes>
Yoon, Daeki's avatar
Yoon, Daeki committed
16
17
        <Route element={<Layout />}>
          <Route path="/" element={<Header />}>
Kim, MinGyu's avatar
Kim, MinGyu committed
18
19
            <Route path="login" element={<Login />} />
            <Route path="signup" element={<Signup />} />
Yoon, Daeki's avatar
Yoon, Daeki committed
20
            <Route index element={<Body />} />
21
22
23
24
25
26
27
28
            <Route
              path="posting"
              element={
                <RequireAuth>
                  <Posting />
                </RequireAuth>
              }
            />
Yoon, Daeki's avatar
Yoon, Daeki committed
29
            <Route path="board" element={<Board />} />
Lee Soobeom's avatar
Lee Soobeom committed
30
31
            <Route path="post/:postId" element={<IntoPost />} />
            <Route path="edit" element={<EditPost />} />
32
33
34
35
36
37
38
39
            <Route
              path="profile"
              element={
                <RequireAuth>
                  <Profile />
                </RequireAuth>
              }
            />
백승민's avatar
백승민 committed
40
            <Route path="admin" element={<RequireAuth><Admin /></RequireAuth>} />
41
            <Route path="admin/:imgId" element={<ImgRewrite />} />
Lee Soobeom's avatar
Lee Soobeom committed
42
            <Route path="rewrite" element={<ImgRewrite />} />
Yoon, Daeki's avatar
Yoon, Daeki committed
43
          </Route>
백승민's avatar
theme1    
백승민 committed
44
45
46
        </Route>
      </Routes>
    </BrowserRouter>
Yoon, Daeki's avatar
Yoon, Daeki committed
47
48
  );
};