Proje: OkulUp · Hub: OkulUp — Decisions
Karar: Custom TabBar ve Custom Drawer
Karar
Expo Router’ın built-in Tabs Navigator ve Drawer Navigator yerine:
- Custom
TabBarcomponent (src/components/layout/TabBar.tsx) - Custom
Drawercomponent (src/components/modules/drawer/Drawer.tsx)
Tab layout: (tabs)/_layout.tsx sadece <Slot /> + <TabBar /> içeriyor.
Why: Hem tab hem drawer içerikleri kullanıcı rolüne ve mobileConfig’e göre dinamik olarak belirleniyor. getTabItems() ve getDrawerItems() fonksiyonları context’e göre farklı item listeleri döndürüyor. Expo’nun default navigator’ları statik route tanımı gerektiriyor — dinamik visibility bu şekilde sağlanamaz.
Ayrıca TabBar’da badge count’ları (unreadTotal, unreadConversations, unreadAnnouncements) gösteriliyor ve Drawer’da ThemeToggle var — bunlar default navigator’a entegre edilemez kolayca.
How to apply: Yeni navigation item eklerken:
NavigationItemIdunion’a ekleNAVIGATION_ITEMSmap’e tanım ekle (surfaces,isVisible)canSeeNavigationItemswitch’e ekle- Route dosyasını
app/(tabs)/veya uygun yere ekle
Related
- navigation-architecture — navigation sistem detayları
- permission-system — navigation visibility logic