sdy

update routes

import React from "react";
import PropTypes from "prop-types";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { Route, Switch, Redirect } from "react-router-dom";
import Auth from "./Auth/AuthContainer";
import RoomList from "./Room/RoomContainer";
import Home from "../Components/Home";
import OTOChat from "./OTOChat/OTOChatContainer";
const LoggedInRoutes = () => (
<>
<Switch>
<Route exact path="/" component={RoomList} />
<Route path="/:roomname" component={Home} />
<Route path="/OTOChat" component={OTOChat} />
<Route path="/RandomChat" component={Home} />
<Route path="/CategoryChat" component={Home} />
<Route path="/Profile" component={Home} />
</>
<Redirect from="*" to="/" />
</Switch>
);
const LoggedOutRoutes = () => (
<>
<Switch>
<Route exact path="/" component={Auth} />
</>
<Redirect from="*" to="/" />
</Switch>
);
const AppRouter = ({ isLoggedIn }) => (
<Router>
<Switch>{isLoggedIn ? <LoggedInRoutes /> : <LoggedOutRoutes />}</Switch>
</Router>
);
const AppRouter = ({ isLoggedIn }) =>
isLoggedIn ? <LoggedInRoutes /> : <LoggedOutRoutes />;
AppRouter.propTypes = {
isLoggedIn: PropTypes.bool.isRequired,
......