|
1 |
| -import './App.css'; |
2 |
| -import { ThemeProvider } from 'styled-components'; |
3 |
| -import theme from '../src/styles/theme'; |
| 1 | +import "./App.css"; |
| 2 | +import { ThemeProvider } from "styled-components"; |
| 3 | +import theme from "../src/styles/theme"; |
4 | 4 | import { BrowserRouter, Route, Routes } from "react-router-dom";
|
5 |
| -import NavigationBar from './components/NavigationBar'; |
6 |
| -import HomePage from './pages/HomePage'; |
7 |
| -import CommunityPage from './pages/CommunityPage'; |
8 |
| -import ChatPage from './pages/chatting/index'; |
9 |
| -import MyPage from './pages/MyPage'; |
10 |
| -import styled from 'styled-components'; |
| 5 | +import NavigationBar from "./components/NavigationBar"; |
| 6 | +import HomePage from "./pages/HomePage"; |
| 7 | +import CommunityPage from "./pages/CommunityPage"; |
| 8 | +import ChatPage from "./pages/chatting/index"; |
| 9 | +import MyPage from "./pages/MyPage"; |
| 10 | +import styled from "styled-components"; |
| 11 | +import StartPage from "./components/login/StartPage"; |
| 12 | +import SignUpSpecific from "./components/login/SignUpSpecific"; |
| 13 | +import Login from "./components/login/Login"; |
| 14 | +import SignUpIDPW from "./components/login/SignUpIDPW"; |
| 15 | +import { useRecoilState } from "recoil"; |
| 16 | +import { loginState } from "./recoil/atoms"; |
11 | 17 |
|
12 | 18 | function App() {
|
13 |
| - return ( |
| 19 | + const [login] = useRecoilState(loginState); |
| 20 | + return login ? ( |
14 | 21 | <ThemeProvider theme={theme}>
|
15 | 22 | <BrowserRouter>
|
16 |
| - <div className="App" style={{display: 'flex'}}> |
| 23 | + <div className="App" style={{ display: "flex" }}> |
17 | 24 | <NavigationBar></NavigationBar>
|
18 | 25 | <PageWrap>
|
19 | 26 | <Routes>
|
20 |
| - <Route path="/" element={<HomePage/>} /> |
21 |
| - <Route path="/community" element={<CommunityPage/>} /> |
22 |
| - <Route path="/chat" element={<ChatPage/>} /> |
23 |
| - <Route path="/mypage" element={<MyPage/>} /> |
| 27 | + <Route path="/" element={<HomePage />} /> |
| 28 | + <Route path="/community" element={<CommunityPage />} /> |
| 29 | + <Route path="/chat" element={<ChatPage />} /> |
| 30 | + <Route path="/mypage" element={<MyPage />} /> |
24 | 31 | </Routes>
|
25 | 32 | </PageWrap>
|
26 | 33 | </div>
|
27 |
| - </BrowserRouter> |
| 34 | + </BrowserRouter> |
| 35 | + </ThemeProvider> |
| 36 | + ) : ( |
| 37 | + <ThemeProvider theme={theme}> |
| 38 | + <BrowserRouter> |
| 39 | + <Routes> |
| 40 | + <Route path="/startPage" element={<StartPage />} /> |
| 41 | + <Route path="/signup1" element={<SignUpIDPW />} /> |
| 42 | + <Route path="/signup2" element={<SignUpSpecific theme={theme} />} /> |
| 43 | + <Route path="/login" element={<Login />} /> |
| 44 | + </Routes> |
| 45 | + </BrowserRouter> |
28 | 46 | </ThemeProvider>
|
29 | 47 | );
|
30 | 48 | }
|
31 | 49 |
|
32 | 50 | const PageWrap = styled.div`
|
33 |
| - flex: 1; |
| 51 | + flex: 1; |
34 | 52 | margin-left: 300px;
|
35 | 53 |
|
36 |
| - ${props => props.theme.response.tablet} { |
| 54 | + ${(props) => props.theme.response.tablet} { |
37 | 55 | margin-left: 100px;
|
38 | 56 | }
|
39 | 57 |
|
40 |
| - ${props => props.theme.response.mobile} { |
| 58 | + ${(props) => props.theme.response.mobile} { |
41 | 59 | margin-left: 0;
|
42 | 60 | margin-bottom: 120px;
|
43 | 61 | }
|
|
0 commit comments