mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
refactor: downloads to minimize prop drilling and improve layout and design (#1337)
Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro.local> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com> Co-authored-by: Simon-Eklundh <simon.eklundh@proton.me>
This commit is contained in:
15
CLAUDE.md
15
CLAUDE.md
@@ -77,6 +77,21 @@ bun run ios:install-metal-toolchain # Fix "missing Metal Toolchain" build error
|
||||
- File-based routing in `app/` directory
|
||||
- Tab navigation: `(home)`, `(search)`, `(favorites)`, `(libraries)`, `(watchlists)`
|
||||
- Shared routes use parenthesized groups like `(home,libraries,search,favorites,watchlists)`
|
||||
- **IMPORTANT**: Always use `useAppRouter` from `@/hooks/useAppRouter` instead of `useRouter` from `expo-router`. This custom hook automatically handles offline mode state preservation across navigation:
|
||||
```typescript
|
||||
// ✅ Correct
|
||||
import useRouter from "@/hooks/useAppRouter";
|
||||
const router = useRouter();
|
||||
|
||||
// ❌ Never use this
|
||||
import { useRouter } from "expo-router";
|
||||
import { router } from "expo-router";
|
||||
```
|
||||
|
||||
**Offline Mode**:
|
||||
- Use `OfflineModeProvider` from `@/providers/OfflineModeProvider` to wrap pages that support offline content
|
||||
- Use `useOfflineMode()` hook to check if current context is offline
|
||||
- The `useAppRouter` hook automatically injects `offline=true` param when navigating within an offline context
|
||||
|
||||
**Providers** (wrapping order in `app/_layout.tsx`):
|
||||
1. JotaiProvider
|
||||
|
||||
Reference in New Issue
Block a user