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:
parent
1c8cb47209
commit
efe331a77a
1 changed files with 5 additions and 11 deletions
|
|
@ -1,16 +1,14 @@
|
|||
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 { useAuth } from "../lib/auth";
|
||||
import { theme } from "../lib/theme";
|
||||
|
||||
// The admin hub is the standalone /crush33 web page (not an app route).
|
||||
const CRUSH_URL = Platform.OS === "web" ? "/crush33" : "https://scan.beartariacampgrounds.com/crush33";
|
||||
|
||||
const ITEMS: { label: string; icon: string; route: string; seg: string; external?: string }[] = [
|
||||
// Note: the /crush33 admin hub is intentionally NOT listed here — it's an
|
||||
// admin-only URL, not surfaced to gate staff in the app drawer.
|
||||
const ITEMS: { label: string; icon: string; route: string; seg: string }[] = [
|
||||
{ label: "Scanner", icon: "📷", route: "/", seg: "" },
|
||||
{ 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" },
|
||||
];
|
||||
|
||||
|
|
@ -35,12 +33,8 @@ export default function SideMenu({ visible, onClose }: { visible: boolean; onClo
|
|||
]).start();
|
||||
}, [visible, panelW, tx, fade]);
|
||||
|
||||
const go = (item: { route: string; seg: string; external?: string }) => {
|
||||
const go = (item: { route: string; seg: string }) => {
|
||||
onClose();
|
||||
if (item.external) {
|
||||
Linking.openURL(item.external).catch(() => {});
|
||||
return;
|
||||
}
|
||||
if (item.seg !== current) router.replace(item.route as any);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue