Skip to content

Commit

Permalink
Merge pull request #1664 from bancorprotocol/fix/batch
Browse files Browse the repository at this point in the history
Redirect if showCart is false
  • Loading branch information
GrandSchtroumpf authored Feb 6, 2025
2 parents 05a8ecc + 72fd087 commit 12569e2
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/core/menu/mainMenu/MainMenuCart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const MainMenuCart = () => {
return () => window.removeEventListener('storage', handler);
});

if (!user) return;

return (
<Link
id="menu-cart-link"
Expand Down
8 changes: 7 additions & 1 deletion src/libs/routing/routes/cart.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { createRoute } from '@tanstack/react-router';
import { createRoute, redirect } from '@tanstack/react-router';
import { rootRoute } from 'libs/routing/routes/root';
import { CartPage } from 'pages/cart';
import config from 'config';

export const cartPage = createRoute({
getParentRoute: () => rootRoute,
path: '/cart',
component: CartPage,
loader: () => {
if (!config.ui.showCart) {
throw redirect({ to: '/' });
}
},
});
2 changes: 0 additions & 2 deletions src/pages/cart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export const CartPage = () => {
}
};

if (!config.ui.showCart) return;

if (!strategies.length) {
return (
<section className="px-content pb-30 xl:px-50 mx-auto grid max-w-[1280px] flex-grow content-start gap-16 pt-20">
Expand Down

0 comments on commit 12569e2

Please sign in to comment.