From 305675e81835ffddd134cf9597dc9acf229d6a25 Mon Sep 17 00:00:00 2001 From: thomasrebam <132445090+thomasrebam@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:47:11 +0100 Subject: [PATCH] chore(example): remove menu from pages without menu (#62) --- packages/example/App.tsx | 65 ++++++++++--------- .../src/components/Menu/MenuContext.tsx | 4 +- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/packages/example/App.tsx b/packages/example/App.tsx index b170d952..00b203df 100644 --- a/packages/example/App.tsx +++ b/packages/example/App.tsx @@ -36,22 +36,24 @@ const RenderMenu = (props: BottomTabBarProps) => ; const TabNavigator = () => { return ( - - - - - - + + + + + + + + ); }; @@ -67,22 +69,21 @@ function App(): JSX.Element { - - - - - - - - + + + + + + + ); diff --git a/packages/example/src/components/Menu/MenuContext.tsx b/packages/example/src/components/Menu/MenuContext.tsx index 7f9d93cb..d9bf52cc 100644 --- a/packages/example/src/components/Menu/MenuContext.tsx +++ b/packages/example/src/components/Menu/MenuContext.tsx @@ -2,9 +2,7 @@ import { createContext, useContext, useMemo, useState } from 'react'; const MenuContext = createContext<{ isOpen: boolean; toggleMenu: (isOpen: boolean) => void }>({ isOpen: false, - toggleMenu: () => { - throw new Error('MenuContext not initialized'); - }, + toggleMenu: () => {}, }); export const MenuProvider = ({ children }: { children: React.ReactNode }) => {