|
|
@ -66,9 +66,10 @@ class AppRouter extends Component { |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const mobile = window.innerWidth < 1000 ? true : false; |
|
|
|
const mobile = window.innerWidth < 1000 ? true : false; |
|
|
|
|
|
|
|
let status = proxy.status(); |
|
|
|
let home = mobile ? ( |
|
|
|
let home = mobile ? ( |
|
|
|
<Route exact path={"/"}> |
|
|
|
<Route exact path={"/"}> |
|
|
|
{proxy.status() ? ( |
|
|
|
{status ? ( |
|
|
|
this.props.profile.status ? ( |
|
|
|
this.props.profile.status ? ( |
|
|
|
<Home /> |
|
|
|
<Home /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
@ -89,105 +90,26 @@ class AppRouter extends Component { |
|
|
|
<Switch> |
|
|
|
<Switch> |
|
|
|
{home} |
|
|
|
{home} |
|
|
|
<Route exact path={"/faq"}> |
|
|
|
<Route exact path={"/faq"}> |
|
|
|
{mobile ? ( |
|
|
|
<Faq /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Faq /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : proxy.status() ? ( |
|
|
|
|
|
|
|
<Faq /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/auth", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/contact"}> |
|
|
|
<Route exact path={"/contact"}> |
|
|
|
{mobile ? ( |
|
|
|
<Contact /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Contact /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Contact /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/blogs"}> |
|
|
|
<Route exact path={"/blogs"}> |
|
|
|
{mobile ? ( |
|
|
|
|
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Blogs /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Blogs /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
<Blogs /> |
|
|
|
<Blogs /> |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/blogs/:id"}> |
|
|
|
<Route exact path={"/blogs/:id"}> |
|
|
|
{mobile ? ( |
|
|
|
<Blog /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Blog /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Blog /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/about"}> |
|
|
|
<Route exact path={"/about"}> |
|
|
|
{mobile ? ( |
|
|
|
<About /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<About /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<About /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/products"}> |
|
|
|
<Route exact path={"/products"}> |
|
|
|
{mobile ? ( |
|
|
|
<Products /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Products /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Products /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/newProfile"}> |
|
|
|
<Route exact path={"/newProfile"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<NewProfile /> |
|
|
|
<NewProfile /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -202,7 +124,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/support"}> |
|
|
|
<Route exact path={"/support"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<Support /> |
|
|
|
<Support /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -216,40 +138,16 @@ class AppRouter extends Component { |
|
|
|
)} |
|
|
|
)} |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/products/digital/:id"}> |
|
|
|
<Route exact path={"/products/digital/:id"}> |
|
|
|
{mobile ? ( |
|
|
|
<Product page="digital" /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Product page="digital" /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Product page="digital" /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/products/physical/:id"}> |
|
|
|
<Route exact path={"/products/physical/:id"}> |
|
|
|
{mobile ? ( |
|
|
|
<Product page="physical" /> |
|
|
|
proxy.status() ? ( |
|
|
|
|
|
|
|
<Product page="physical" /> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Product page="physical" /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/qr"}> |
|
|
|
<Route exact path={"/qr"}> |
|
|
|
<QR /> |
|
|
|
<QR /> |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/auth"}> |
|
|
|
<Route exact path={"/auth"}> |
|
|
|
{proxy.status() ? ( |
|
|
|
{status ? ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
|
to={{ |
|
|
|
to={{ |
|
|
|
pathname: "/", |
|
|
|
pathname: "/", |
|
|
@ -261,7 +159,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/profile"}> |
|
|
|
<Route exact path={"/profile"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<Auth page={"profile"} /> |
|
|
|
<Auth page={"profile"} /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -270,7 +168,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<Auth page={"profile"} /> |
|
|
|
<Auth page={"profile"} /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -282,7 +180,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/qr-scan"}> |
|
|
|
<Route exact path={"/qr-scan"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<QRScan /> |
|
|
|
<QRScan /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -291,7 +189,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<QRScan /> |
|
|
|
<QRScan /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -303,7 +201,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/activation"}> |
|
|
|
<Route exact path={"/activation"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<Activation /> |
|
|
|
<Activation /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -312,7 +210,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<Activation /> |
|
|
|
<Activation /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -324,7 +222,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/chatroom"}> |
|
|
|
<Route exact path={"/chatroom"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<ChatList /> |
|
|
|
<ChatList /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -333,7 +231,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<ChatList /> |
|
|
|
<ChatList /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -345,7 +243,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/cart"}> |
|
|
|
<Route exact path={"/cart"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
this.props.userProductList.length > 0 || |
|
|
|
this.props.userProductList.length > 0 || |
|
|
|
!this.state.cartControll ? ( |
|
|
|
!this.state.cartControll ? ( |
|
|
|
<Cart /> |
|
|
|
<Cart /> |
|
|
@ -364,7 +262,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
!this.state.cartControll || |
|
|
|
!this.state.cartControll || |
|
|
|
this.props.userProductList.length > 0 ? ( |
|
|
|
this.props.userProductList.length > 0 ? ( |
|
|
|
<Cart /> |
|
|
|
<Cart /> |
|
|
@ -386,7 +284,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/mybooks"}> |
|
|
|
<Route exact path={"/mybooks"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<MyBooks /> |
|
|
|
<MyBooks /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -395,7 +293,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<MyBooks /> |
|
|
|
<MyBooks /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -407,7 +305,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/ar"}> |
|
|
|
<Route exact path={"/ar"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<AR /> |
|
|
|
<AR /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -416,7 +314,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<AR /> |
|
|
|
<AR /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -431,7 +329,7 @@ class AppRouter extends Component { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route exact path={"/chatroom/:id"}> |
|
|
|
<Route exact path={"/chatroom/:id"}> |
|
|
|
{mobile ? ( |
|
|
|
{mobile ? ( |
|
|
|
proxy.status() ? ( |
|
|
|
status ? ( |
|
|
|
<Chatroom /> |
|
|
|
<Chatroom /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -440,7 +338,7 @@ class AppRouter extends Component { |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) |
|
|
|
) |
|
|
|
) : proxy.status() ? ( |
|
|
|
) : status ? ( |
|
|
|
<Chatroom /> |
|
|
|
<Chatroom /> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
@ -451,25 +349,17 @@ class AppRouter extends Component { |
|
|
|
)} |
|
|
|
)} |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route path={""}> |
|
|
|
<Route path={""}> |
|
|
|
{proxy.status() ? ( |
|
|
|
<Redirect |
|
|
|
<Redirect |
|
|
|
to={{ |
|
|
|
to={{ |
|
|
|
pathname: "/qr", |
|
|
|
pathname: "/qr", |
|
|
|
search: |
|
|
|
search: |
|
|
|
"?id=" + |
|
|
|
"?id=" + |
|
|
|
window.location.pathname.slice( |
|
|
|
window.location.pathname.slice( |
|
|
|
window.location.pathname.lastIndexOf("/") + 1, |
|
|
|
window.location.pathname.lastIndexOf("/") + 1, |
|
|
|
window.location.pathname.length |
|
|
|
window.location.pathname.length |
|
|
|
), |
|
|
|
), |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Redirect |
|
|
|
|
|
|
|
to={{ |
|
|
|
|
|
|
|
pathname: "/auth", |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
</Switch> |
|
|
|
</Switch> |
|
|
|
</Router> |
|
|
|
</Router> |
|
|
|