Restrict "automation" tab visibility based on admin role

This commit is contained in:
2026-05-13 11:03:11 +02:00
parent 26a4d0144c
commit e4b228779c

View File

@@ -67,12 +67,12 @@ export default function ProtectedLayout() {
tabBarIcon: ({ color, size }) => <Building pointerEvents="none" color={color} size={24} />,
}}
/>
{/* // TODO: Probably needs to be restricted to admin */}
<Tabs.Screen
name="automation"
options={{
title: 'Domotica',
tabBarIcon: ({ color, size }) => <Zap pointerEvents="none" color={color} size={24} />,
href: authState.user?.role === 'Amministratore' ? undefined : null,
}}
/>
{/* TODO: Should be removed - move tabs inside (tabs) and refactor _layout */}