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