|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
import './App.scss';
|
|
import './App.scss';
|
|
-import Header from './components/Header/Header';
|
|
|
|
|
|
+import RoutedHeader from './components/Header/Header';
|
|
import CMain from './components/MainPage/Main';
|
|
import CMain from './components/MainPage/Main';
|
|
import CLoginForm from './components/LoginPage/Login';
|
|
import CLoginForm from './components/LoginPage/Login';
|
|
import CRegister from './components/RegisterPage/Register';
|
|
import CRegister from './components/RegisterPage/Register';
|
|
@@ -17,14 +17,18 @@ function App() {
|
|
return (
|
|
return (
|
|
<Router history={history}>
|
|
<Router history={history}>
|
|
<Provider store={store}>
|
|
<Provider store={store}>
|
|
- <Switch>
|
|
|
|
|
|
+
|
|
<div className="App">
|
|
<div className="App">
|
|
|
|
+ <Route path="/login" exact component={CLoginForm}/>
|
|
|
|
+ <Route exact path="/register" component={CRegister}/>
|
|
|
|
+ <RoutedHeader />
|
|
|
|
+ <CMain/>
|
|
{/* localStorage.getItem("authToken") */
|
|
{/* localStorage.getItem("authToken") */
|
|
/* store.getState().auth.payload?.sub?.id ? <Redirect to="/"/> : <Redirect to="/login"/> */}
|
|
/* store.getState().auth.payload?.sub?.id ? <Redirect to="/"/> : <Redirect to="/login"/> */}
|
|
- <Route exact path="/login" component={CLoginForm}/>
|
|
|
|
- <Route exact path="/register" component={CRegister}/>
|
|
|
|
|
|
+ {/* <Route exact path="/login" component={CLoginForm}/>
|
|
|
|
+ <Route exact path="/register" component={CRegister}/> */}
|
|
{/* {store.auth.payload?.sub?.id ? <Redirect to="/"/> : <Redirect to="/login"/>} */}
|
|
{/* {store.auth.payload?.sub?.id ? <Redirect to="/"/> : <Redirect to="/login"/>} */}
|
|
- <Route exact path="/" component={Header}/>
|
|
|
|
|
|
+ {/* <Route exact path="/" component={Header}/>
|
|
<Route exact path="/" component={CMain}/>
|
|
<Route exact path="/" component={CMain}/>
|
|
<Route exact path="/collections" component={Header}/>
|
|
<Route exact path="/collections" component={Header}/>
|
|
<Route exact path="/collections" component={CMain}/>
|
|
<Route exact path="/collections" component={CMain}/>
|
|
@@ -34,9 +38,8 @@ function App() {
|
|
<Route exact path="/user/:id" component={Header}/>
|
|
<Route exact path="/user/:id" component={Header}/>
|
|
<Route exact path="/user/:id" component={CMain}/>
|
|
<Route exact path="/user/:id" component={CMain}/>
|
|
<Route exact path="/post/:id" component={Header}/>
|
|
<Route exact path="/post/:id" component={Header}/>
|
|
- <Route exact path="/post/:id" component={CMain}/>
|
|
|
|
|
|
+ <Route exact path="/post/:id" component={CMain}/> */}
|
|
</div>
|
|
</div>
|
|
- </Switch>
|
|
|
|
</Provider>
|
|
</Provider>
|
|
</Router>
|
|
</Router>
|
|
);
|
|
);
|