App.tsx 1.59 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";
Kim, MinGyu's avatar
Kim, MinGyu committed
5
6
7
8
9
10
11
12
13
import {
  Login,
  Profile,
  RequireAuth,
  Signup,
  Admin,
  ImgRewrite,
  Search,
} from "./auth";
14
import { Header, Body } from "./home";
Lee Soobeom's avatar
Lee Soobeom committed
15
import { Board } from "./board";
16
import Posting from "./post/posting";
Yoon, Daeki's avatar
Yoon, Daeki committed
17
import { Layout } from "./commons";
Lee Soobeom's avatar
Lee Soobeom committed
18
import { EditPost } from "./post/editpost";
Yoon, Daeki's avatar
Yoon, Daeki committed
19
20
21

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