Restrict "automation" tab visibility based on admin role
This commit is contained in:
@@ -67,12 +67,12 @@ export default function ProtectedLayout() {
|
|||||||
tabBarIcon: ({ color, size }) => <Building pointerEvents="none" color={color} size={24} />,
|
tabBarIcon: ({ color, size }) => <Building pointerEvents="none" color={color} size={24} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* // TODO: Probably needs to be restricted to admin */}
|
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="automation"
|
name="automation"
|
||||||
options={{
|
options={{
|
||||||
title: 'Domotica',
|
title: 'Domotica',
|
||||||
tabBarIcon: ({ color, size }) => <Zap pointerEvents="none" color={color} size={24} />,
|
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 */}
|
{/* TODO: Should be removed - move tabs inside (tabs) and refactor _layout */}
|
||||||
|
|||||||
Reference in New Issue
Block a user