App.tsx 1.25 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";
5
import { Login, Profile, RequireAuth, Signup } 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";
Yoon, Daeki's avatar
Yoon, Daeki committed
10
11
12

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