fix: remove crap

This commit is contained in:
cha0s 2020-12-08 07:34:34 -06:00
parent 5604b84df1
commit dad132029c

View File

@ -4,8 +4,7 @@ import {isAnonymousSelector} from '@reddichat/user/client';
import React from 'react';
import {useSelector} from 'react-redux';
import {hot} from 'react-hot-loader';
import {Route, Router, Switch} from 'react-router-dom';
import {createBrowserHistory} from 'history';
import {Route, Switch} from 'react-router-dom';
import About from 'components/about';
import Chat from 'components/chat';
@ -13,33 +12,29 @@ import Home from 'components/home';
import Left from 'components/left';
import Right from 'components/right';
const history = createBrowserHistory();
const App = () => {
const isAnonymous = useSelector(isAnonymousSelector);
return (
<div className="app">
{<Left />}
<Router history={history}>
<Switch>
<Route
component={Home}
exact
path="/"
/>
<Route
component={About}
path="/about"
/>
<Route
component={Chat}
path="/chat"
/>
</Switch>
</Router>
{<Right />}
{!isAnonymous && <Left />}
<Switch>
<Route
component={Home}
exact
path="/"
/>
<Route
component={About}
path="/about"
/>
<Route
component={Chat}
path="/chat"
/>
</Switch>
{!isAnonymous && <Right />}
</div>
)
);
};
export default hot(module)(App);