-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
32 lines (29 loc) · 843 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import styled from 'styled-components';
// page
import MainPage from './component/page/MainPage';
import PostWritePage from './component/page/PostWritePage';
import PostViewPage from './component/page/PostViewPage';
const MainTitle = styled.p`
padding: 16px;
margin: auto;
color: white;
background-color: #03c75a;
font-size: 24px;
font-weight: bold;
text-align: center;
`;
function App() {
return (
<BrowserRouter>
<MainTitle>리액트 - 미니 블로그</MainTitle>
<Routes>
<Route index element={<MainPage />} />
<Route path="post-write" element={<PostWritePage />} />
<Route path="post/:postId" element={<PostViewPage />} />
</Routes>
</BrowserRouter>
);
}
export default App;