App.tsx 1.51 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
18
19
20
        <Route element={<Layout />}>
          <Route path="login" element={<Login />} />
          <Route path="signup" element={<Signup />} />
          <Route path="/" element={<Header />}>
            <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
32
            <Route path="post/:postId" element={<IntoPost />} />
            <Route path="edit" element={<EditPost />} />
            {/* </Route> */}
33
34
35
36
37
38
39
40
            <Route
              path="profile"
              element={
                <RequireAuth>
                  <Profile />
                </RequireAuth>
              }
            />
백승민's avatar
백승민 committed
41
            <Route path="admin" element={<Admin />} />
백승민's avatar
백승민 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
  );
};