Hide /crush33 from the staff drawer (admin-only URL)

The admin hub link was showing in the app side menu; removed it so it
isn't surfaced to gate staff. /crush33 is reached by URL only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hank 2026-07-23 01:58:08 +00:00
parent 1c8cb47209
commit efe331a77a

View file

@ -1,16 +1,14 @@
import { useEffect, useRef } from "react"; import { useEffect, useRef } from "react";
import { Animated, StyleSheet, View, Text, Pressable, Easing, useWindowDimensions, Linking, Platform } from "react-native"; import { Animated, StyleSheet, View, Text, Pressable, Easing, useWindowDimensions } from "react-native";
import { router, useSegments } from "expo-router"; import { router, useSegments } from "expo-router";
import { useAuth } from "../lib/auth"; import { useAuth } from "../lib/auth";
import { theme } from "../lib/theme"; import { theme } from "../lib/theme";
// The admin hub is the standalone /crush33 web page (not an app route). // Note: the /crush33 admin hub is intentionally NOT listed here — it's an
const CRUSH_URL = Platform.OS === "web" ? "/crush33" : "https://scan.beartariacampgrounds.com/crush33"; // admin-only URL, not surfaced to gate staff in the app drawer.
const ITEMS: { label: string; icon: string; route: string; seg: string }[] = [
const ITEMS: { label: string; icon: string; route: string; seg: string; external?: string }[] = [
{ label: "Scanner", icon: "📷", route: "/", seg: "" }, { label: "Scanner", icon: "📷", route: "/", seg: "" },
{ label: "Event report", icon: "📊", route: "/stats", seg: "stats" }, { label: "Event report", icon: "📊", route: "/stats", seg: "stats" },
{ label: "Admin (crush33)", icon: "🔐", route: "", seg: "__admin", external: CRUSH_URL },
{ label: "Banquet lookup", icon: "🍽️", route: "/admin", seg: "admin" }, { label: "Banquet lookup", icon: "🍽️", route: "/admin", seg: "admin" },
]; ];
@ -35,12 +33,8 @@ export default function SideMenu({ visible, onClose }: { visible: boolean; onClo
]).start(); ]).start();
}, [visible, panelW, tx, fade]); }, [visible, panelW, tx, fade]);
const go = (item: { route: string; seg: string; external?: string }) => { const go = (item: { route: string; seg: string }) => {
onClose(); onClose();
if (item.external) {
Linking.openURL(item.external).catch(() => {});
return;
}
if (item.seg !== current) router.replace(item.route as any); if (item.seg !== current) router.replace(item.route as any);
}; };