Proje: OkulUp · Hub: OkulUp — Conventions

Utility Hooks ve Utils

Sık Kullanılan Utility Hooks

useBottomTabOffset

const bottomOffset = useBottomTabOffset(extraSpacing?: number);
// TabBar height (64) + SafeArea bottom + extraSpacing (24)
// FlatList contentContainerStyle: { paddingBottom: bottomOffset }

usePullToRefresh

const { isRefreshing, onRefresh } = usePullToRefresh(refreshAction);
// Concurrent refresh koruması: aynı anda birden fazla çekilme önlenir

useRefreshOnFocus

Expo Router ekranı focus alınca veriyi yeniler. React Query ile kullanılır.

useNetworkStatus

const { isOffline } = useNetworkStatus();
// @react-native-community/netinfo kulllanıyor

Utility Dosyaları (src/utils/)

Dosyaİçerik
permissions.tscanAccess, getTabItems, getDrawerItems, getUserScope
imagePicker.tspickImage(), captureImage(), pickDocument(), createFormData()
formatters.tsPara, tarih formatlama
helpers.tsGenel yardımcı fonksiyonlar
media.tsnormalizeMediaUrl(), thumbnail URL’leri
validators.tsValidation helpers
messages.tsMesaj utility fonksiyonları
biometricAuth.tsFace ID / Touch ID, expo-local-authentication
deviceCalendar.tsExpo Calendar entegrasyonu
appointmentReminder.tsRandevu hatırlatıcı
message-conversation.tsKonuşma helpers

Image Picker

pickImage()       → galeriden seç
captureImage()    → kamera ile çek
pickDocument()    → expo-document-picker ile belge seç
createFormData()  → PickedImage → FormData dönüştür (upload için)

Permission talep Türkçe Alert ile yapılıyor.