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 önleniruseRefreshOnFocus
Expo Router ekranı focus alınca veriyi yeniler. React Query ile kullanılır.
useNetworkStatus
const { isOffline } = useNetworkStatus();
// @react-native-community/netinfo kulllanıyorUtility Dosyaları (src/utils/)
| Dosya | İçerik |
|---|---|
permissions.ts | canAccess, getTabItems, getDrawerItems, getUserScope |
imagePicker.ts | pickImage(), captureImage(), pickDocument(), createFormData() |
formatters.ts | Para, tarih formatlama |
helpers.ts | Genel yardımcı fonksiyonlar |
media.ts | normalizeMediaUrl(), thumbnail URL’leri |
validators.ts | Validation helpers |
messages.ts | Mesaj utility fonksiyonları |
biometricAuth.ts | Face ID / Touch ID, expo-local-authentication |
deviceCalendar.ts | Expo Calendar entegrasyonu |
appointmentReminder.ts | Randevu hatırlatıcı |
message-conversation.ts | Konuş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.
Related
- component-architecture — hooks kullanımı
- service-layer-pattern — createFormData upload kullanımı