|
|
|
@ -17,6 +17,7 @@ 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 Reset from "./views/Reset"; |
|
|
|
|
import Auth from "./views/Auth/index"; |
|
|
|
|
import QRScan from "./views/QRScan/index"; |
|
|
|
|
import Activation from "./views/Activation/index"; |
|
|
|
@ -75,7 +76,7 @@ class AppRouter extends Component { |
|
|
|
|
let home = ( |
|
|
|
|
<Route exact path={"/"}> |
|
|
|
|
{status && status.status === 0 ? ( |
|
|
|
|
<Auth page={"profile"} /> |
|
|
|
|
<Auth page={"profile"} lang={this.props.lang} /> |
|
|
|
|
) : afterLogin ? ( |
|
|
|
|
<> |
|
|
|
|
<Redirect |
|
|
|
@ -85,60 +86,64 @@ class AppRouter extends Component { |
|
|
|
|
/> |
|
|
|
|
</> |
|
|
|
|
) : ( |
|
|
|
|
<Home status={status} /> |
|
|
|
|
<Home status={status} lang={this.props.lang} /> |
|
|
|
|
)} |
|
|
|
|
</Route> |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div |
|
|
|
|
className={`flex-1 ${ |
|
|
|
|
className={` ${ |
|
|
|
|
localStorage.getItem("language") === "en" ? "ltr" : "rtl" |
|
|
|
|
}`}
|
|
|
|
|
style={{ height: "100%" }} |
|
|
|
|
> |
|
|
|
|
<Router> |
|
|
|
|
<Switch> |
|
|
|
|
{home} |
|
|
|
|
<Route exact path={"/reset"}> |
|
|
|
|
<Reset lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/faq"}> |
|
|
|
|
<Faq /> |
|
|
|
|
<Faq lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/contact"}> |
|
|
|
|
<Contact /> |
|
|
|
|
<Contact lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/download"}> |
|
|
|
|
<Download /> |
|
|
|
|
<Download lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/blogs"}> |
|
|
|
|
<Blogs /> |
|
|
|
|
<Blogs lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/blogs/:id"}> |
|
|
|
|
<Blog /> |
|
|
|
|
<Blog lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/page/:name"}> |
|
|
|
|
<Blog /> |
|
|
|
|
<Blog lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/about"}> |
|
|
|
|
<About /> |
|
|
|
|
<About lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/products"}> |
|
|
|
|
<Products /> |
|
|
|
|
<Products lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path="/orders"> |
|
|
|
|
<Orders /> |
|
|
|
|
<Orders lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path="/mybooks"> |
|
|
|
|
<MyBooks /> |
|
|
|
|
<MyBooks lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
{/* <Route path={"/sample"}> |
|
|
|
|
<Sample /> |
|
|
|
|
</Route> */} |
|
|
|
|
<Route path={"/pdf"}> |
|
|
|
|
<PDF /> |
|
|
|
|
<PDF lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/newProfile"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<NewProfile /> |
|
|
|
|
<NewProfile lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -153,7 +158,7 @@ class AppRouter extends Component { |
|
|
|
|
<Route exact path={"/support"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<Support /> |
|
|
|
|
<Support lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -166,13 +171,13 @@ class AppRouter extends Component { |
|
|
|
|
)} |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/products/digital/:id"}> |
|
|
|
|
<Product page="digital" /> |
|
|
|
|
<Product page="digital" lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/products/physical/:id"}> |
|
|
|
|
<Product page="physical" /> |
|
|
|
|
<Product page="physical" lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/qr"}> |
|
|
|
|
<QR /> |
|
|
|
|
<QR lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/auth"}> |
|
|
|
|
{proxy.status() ? ( |
|
|
|
@ -182,11 +187,11 @@ class AppRouter extends Component { |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
) : ( |
|
|
|
|
<NewProfile /> |
|
|
|
|
<Auth lang={this.props.lang} /> |
|
|
|
|
)} |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/support"}> |
|
|
|
|
<Support /> |
|
|
|
|
<Support lang={this.props.lang} /> |
|
|
|
|
{/* {mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<Support /> |
|
|
|
@ -202,13 +207,13 @@ class AppRouter extends Component { |
|
|
|
|
)} */} |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/products/digital/:id"}> |
|
|
|
|
<Product page="digital" /> |
|
|
|
|
<Product page="digital" lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/products/physical/:id"}> |
|
|
|
|
<Product page="physical" /> |
|
|
|
|
<Product page="physical" lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/qr"}> |
|
|
|
|
<QR /> |
|
|
|
|
<QR lang={this.props.lang} /> |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/auth"}> |
|
|
|
|
{proxy.status() ? ( |
|
|
|
@ -218,16 +223,16 @@ class AppRouter extends Component { |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
) : ( |
|
|
|
|
<Auth /> |
|
|
|
|
<Auth lang={this.props.lang} /> |
|
|
|
|
)} |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/profile"}> |
|
|
|
|
{status ? <Auth page={"profile"} /> : null} |
|
|
|
|
{status ? <Auth page={"profile"} lang={this.props.lang} /> : null} |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/qr-scan"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<QRScan /> |
|
|
|
|
<QRScan lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -236,7 +241,7 @@ class AppRouter extends Component { |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
) : status ? ( |
|
|
|
|
<QRScan /> |
|
|
|
|
<QRScan lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -248,7 +253,7 @@ class AppRouter extends Component { |
|
|
|
|
<Route exact path={"/activation"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<Activation /> |
|
|
|
|
<Activation lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -257,7 +262,7 @@ class AppRouter extends Component { |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
) : status ? ( |
|
|
|
|
<Activation /> |
|
|
|
|
<Activation lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -269,7 +274,7 @@ class AppRouter extends Component { |
|
|
|
|
<Route exact path={"/chatroom"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<ChatList /> |
|
|
|
|
<ChatList lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -278,7 +283,7 @@ class AppRouter extends Component { |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
) : status ? ( |
|
|
|
|
<ChatList /> |
|
|
|
|
<ChatList lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -288,7 +293,7 @@ class AppRouter extends Component { |
|
|
|
|
)} |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/cart"}> |
|
|
|
|
<Cart /> |
|
|
|
|
<Cart lang={this.props.lang} /> |
|
|
|
|
{/* {status ? ( |
|
|
|
|
<Cart /> |
|
|
|
|
) : ( |
|
|
|
@ -301,7 +306,7 @@ class AppRouter extends Component { |
|
|
|
|
</Route> |
|
|
|
|
<Route exact path={"/checkout"}> |
|
|
|
|
{status ? ( |
|
|
|
|
<Checkout /> |
|
|
|
|
<Checkout lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -334,7 +339,7 @@ class AppRouter extends Component { |
|
|
|
|
<Route exact path={"/ar"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<AR /> |
|
|
|
|
<AR lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -343,7 +348,7 @@ class AppRouter extends Component { |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
) : status ? ( |
|
|
|
|
<AR /> |
|
|
|
|
<AR lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -356,7 +361,7 @@ class AppRouter extends Component { |
|
|
|
|
<Route exact path={"/chatroom/:id"}> |
|
|
|
|
{mobile ? ( |
|
|
|
|
status ? ( |
|
|
|
|
<Chatroom /> |
|
|
|
|
<Chatroom lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -365,7 +370,7 @@ class AppRouter extends Component { |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
) : status ? ( |
|
|
|
|
<Chatroom /> |
|
|
|
|
<Chatroom lang={this.props.lang} /> |
|
|
|
|
) : ( |
|
|
|
|
<Redirect |
|
|
|
|
to={{ |
|
|
|
@ -399,6 +404,7 @@ export default connect( |
|
|
|
|
profile: state.user.status, |
|
|
|
|
userProductList: state.userProduct.list, |
|
|
|
|
config: state.publicApi.config, |
|
|
|
|
lang: state.publicApi.lang, |
|
|
|
|
// status: state.user.status,
|
|
|
|
|
}), |
|
|
|
|
{ getProfile: user.getProfile, getUserProductList: userProduct.list } |
|
|
|
|