|
|
|
import React, { Component } from 'react';
|
|
|
|
import './App.css';
|
|
|
|
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
|
|
|
|
// import proxy from './Redux/proxy';
|
|
|
|
import Home from './views/Home/index';
|
|
|
|
import Faq from './views/Faq/index';
|
|
|
|
import Contact from './views/Contact/index';
|
|
|
|
import About from './views/About/index';
|
|
|
|
import Products from './views/Products/index';
|
|
|
|
import Product from './views/Product/index';
|
|
|
|
import QR from './views/QR/index';
|
|
|
|
import Auth from './views/Auth/index';
|
|
|
|
import QRScan from './views/QRScan/index';
|
|
|
|
import Activation from './views/Activation/index';
|
|
|
|
import ChatList from './views/ChatList/index';
|
|
|
|
import Chatroom from './views/ChatRoom/index';
|
|
|
|
import Cart from './views/Cart/index';
|
|
|
|
|
|
|
|
class AppRouter extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
window.router = this;
|
|
|
|
}
|
|
|
|
state = {};
|
|
|
|
render() {
|
|
|
|
let home = (
|
|
|
|
<Route exact path={'/'}>
|
|
|
|
<Home />
|
|
|
|
{/* {proxy.status() ? <Home /> : <Auth />} */}
|
|
|
|
</Route>
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Router>
|
|
|
|
<Switch>
|
|
|
|
{home}
|
|
|
|
{/* <Route path={'/list'}>
|
|
|
|
<List />
|
|
|
|
</Route> */}
|
|
|
|
<Route path={'/faq'}>
|
|
|
|
<Faq />
|
|
|
|
</Route>
|
|
|
|
<Route path={'/contact'}>
|
|
|
|
<Contact />
|
|
|
|
</Route>
|
|
|
|
<Route path={'/about'}>
|
|
|
|
<About />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/products'}>
|
|
|
|
<Products />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/products/:id'}>
|
|
|
|
<Product />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/qr'}>
|
|
|
|
<QR />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/auth'}>
|
|
|
|
<Auth />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/profile'}>
|
|
|
|
<Auth page={'profile'} />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/qr-scan'}>
|
|
|
|
<QRScan />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/activation'}>
|
|
|
|
<Activation />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/chatroom'}>
|
|
|
|
<ChatList />
|
|
|
|
</Route>
|
|
|
|
<Route exact path={'/cart'}>
|
|
|
|
<Cart />
|
|
|
|
</Route>
|
|
|
|
{
|
|
|
|
window.innerWidth < 1000 ?
|
|
|
|
<Route exact path={'/chatroom/:id'}>
|
|
|
|
<Chatroom />
|
|
|
|
</Route> : null
|
|
|
|
}
|
|
|
|
</Switch>
|
|
|
|
</Router>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AppRouter;
|