very basics of auth state - not actually authenticating anything right now....
This commit is contained in:
@@ -3,6 +3,9 @@ import { Tabs } from 'expo-router'
|
||||
import React from 'react'
|
||||
|
||||
export default function TabLayout() {
|
||||
const isAdmin = localStorage.getItem('session') === 'admin'
|
||||
console.log(isAdmin)
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
screenOptions={{
|
||||
@@ -32,15 +35,16 @@ export default function TabLayout() {
|
||||
options={{
|
||||
title: 'Posts',
|
||||
headerShown: false,
|
||||
tabBarItemStyle: { display: isAdmin ? 'flex' : 'none' },
|
||||
tabBarIcon: ({ color, focused }) => (
|
||||
<Ionicons name={focused ? 'rocket-sharp' : 'rocket-outline'} size={24} color={color} />
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name='login'
|
||||
name='profile'
|
||||
options={{
|
||||
title: 'Login',
|
||||
title: 'Profile',
|
||||
headerShown: false,
|
||||
tabBarIcon: ({ color, focused }) => (
|
||||
<Ionicons
|
||||
|
||||
Reference in New Issue
Block a user