From 6bd5ea5fbce7d54799e303f1bc888ee650e9147c Mon Sep 17 00:00:00 2001 From: Madalina Raicu Date: Tue, 6 Feb 2024 14:25:52 +0000 Subject: [PATCH] feat(trading): add back button --- apps/trading/components/sidebar/sidebar.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/trading/components/sidebar/sidebar.tsx b/apps/trading/components/sidebar/sidebar.tsx index 757fc48ef..50ccb8f37 100644 --- a/apps/trading/components/sidebar/sidebar.tsx +++ b/apps/trading/components/sidebar/sidebar.tsx @@ -63,6 +63,11 @@ export const Sidebar = ({ options }: { options?: ReactNode }) => { const setViewAsDialogOpen = useViewAsDialog((state) => state.setOpen); const { pubKeys } = useVegaWallet(); const { isMobile } = useScreenDimensions(); + const { getView } = useSidebar((store) => ({ + setViews: store.setViews, + getView: store.getView, + })); + const currView = getView(currentRouteId); return (
{options && ( @@ -101,12 +106,14 @@ export const Sidebar = ({ options }: { options?: ReactNode }) => { /> ) : ( - + currView && ( + + ) )}