Skip to content

Commit 5151b96

Browse files
committed
Hide the debug menu behind an env var
1 parent 4728458 commit 5151b96

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

packages/mobile-app/.env.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
EXPO_PUBLIC_DEMO_API=false
2-
EXPO_PUBLIC_DISABLE_PIN_LOCK=false
2+
EXPO_PUBLIC_DISABLE_PIN_LOCK=false
3+
EXPO_PUBLIC_ENABLE_DEBUG_MENU=false

packages/mobile-app/app/(drawer)/app-settings/index.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,22 @@ const MENU_ROUTES = {
3232
},
3333
} as const;
3434

35-
const menuItems = Object.values(MENU_ROUTES).map((item) => {
36-
return {
37-
title: item.title,
38-
href: item.href,
39-
path: item.href.concat("/index"),
40-
};
41-
});
35+
const menuItems = Object.entries(MENU_ROUTES)
36+
.map(([key, item]) => {
37+
if (
38+
key === "debug" &&
39+
process.env.EXPO_PUBLIC_ENABLE_DEBUG_MENU !== "true"
40+
) {
41+
return null;
42+
}
43+
44+
return {
45+
title: item.title,
46+
href: item.href,
47+
path: item.href.concat("/index"),
48+
};
49+
})
50+
.filter((item) => item !== null);
4251

4352
export default function MenuScreen() {
4453
const router = useRouter();

0 commit comments

Comments
 (0)