The Quick Categories feature provides an easy way for users to browse recipes by cuisine type directly from the home screen. It displays horizontal scrollable cards showing different cuisine categories with sample recipes and recipe counts.
- Italian 🍝 - Pasta, pizza, and classic Italian dishes
- Mexican 🌮 - Tacos, burritos, and Mexican favorites
- Asian 🥢 - Asian-inspired dishes including teriyaki, stir-fries
- American 🍔 - Burgers, BBQ, and classic American comfort food
- Mediterranean 🫒 - Greek salads, healthy Mediterranean cuisine
- Indian 🍛 - Curries, tikka masala, and Indian spices
- Horizontal Scroll: Swipe left/right to browse categories
- Recipe Preview: Each card shows 2-3 sample recipes from that category
- Recipe Count: Displays total number of recipes in each category
- Tap to Navigate: Tap any category card to view all recipes in that category
- Recipe Images: Shows recipe thumbnails when available
- Responsive Design: Cards adapt to different screen sizes
- Uses
RecipeDatabase.getRecipesByCategory()to fetch recipes by cuisine type - Automatically filters categories that have no recipes
- Loads up to 3 sample recipes per category for preview
- Includes sample recipes with different cuisine types for testing
- Automatically creates demo recipes when app starts (demo mode only)
- Sample recipes include images from Unsplash for visual appeal
- Integrates with existing recipe navigation system
- Passes category filter to recipes page when category is selected
- Automatic Filtering: When user taps a category, the recipes page automatically:
- Shows the search filters
- Pre-selects the chosen cuisine category
- Displays only recipes from that category
- Supports deep linking to specific categories with URL parameters
- Browse Categories: Scroll horizontally through available cuisine types
- Preview Recipes: See 2-3 sample recipes in each category card
- View All Recipes: Tap "View All →" or anywhere on a category card
- Visual Feedback: Cards animate when pressed for better UX
- Adding New Categories: Update the categories array in
loadCategoryRecipes() - Styling Categories: Modify styles in the
categoriesSectionstyle group - Custom Images: Update recipe
image_urlfield for better visuals - Category Logic: Recipes are categorized by the
cuisine_typefield
app/(tabs)/index.tsx- Main implementation of Quick Categories UIapp/(tabs)/recipes.tsx- Added URL parameter support for category filteringcomponents/RecipeList.tsx- Added initial category filter supportcomponents/RecipeSearchFilter.tsx- Added initial values support for pre-filteringservices/recipeDatabase.ts- Added category filtering functionsservices/demoStorage.ts- Added demo recipes with categories
RecipeDatabase.getRecipesByCategory()- Fetch recipes by cuisine typeRecipeDatabase.getAvailableCategories()- Get list of all categoriesDemoStorage.createDemoRecipesWithCategories()- Create sample data
- Width: 200px fixed width for consistent layout
- Padding: 16px internal spacing
- Border Radius: Uses theme radius for consistent design
- Background: Uses theme surface color
- Shadow: Elevation effect for depth
- Image Size: 24x24px thumbnails
- Text: 11px font size for compact display
- Layout: Horizontal layout with image and title
- Fallback: Shows utensils icon when no image available
- Lazy Loading: Only categories with recipes are displayed
- Image Caching: React Native automatically caches recipe images
- Memory Efficient: Demo recipes only created once on app start
- Smooth Scrolling: Horizontal ScrollView optimized for performance
- Dynamic Categories: Auto-detect categories from existing recipes
- Category Management: Allow users to create custom categories
- Advanced Filtering: Combine categories with other filters (time, difficulty)
- Category Analytics: Track which categories are most popular
- Search Integration: Quick search within categories
- Sorting Options: Sort categories by popularity or alphabetically
- Category Icons: Replace emojis with custom SVG icons
- Infinite Scroll: Load more recipes as user scrolls within category
- Empty Categories: Ensure recipes have
cuisine_typefield set - Missing Images: Check that
image_urlis valid and accessible - Navigation Issues: Verify router.push parameters are correct
- Style Problems: Check that all required styles are defined
- Use console.log to check
categoryRecipesstate - Verify demo recipes are created with correct
cuisine_type - Check network connectivity for recipe images
- Test on different screen sizes for responsive behavior
- Empty State: App with no recipes should not show categories
- Single Category: App with recipes in only one category
- Multiple Categories: App with recipes across all categories
- Navigation: Tapping categories navigates to correct filtered view
- Images: Both recipes with and without images display correctly
The demo includes sample recipes for testing:
- Italian: Spaghetti Carbonara
- Indian: Chicken Tikka Masala
- Mexican: Classic Beef Tacos
- Asian: Chicken Teriyaki Bowl
- American: Classic Cheeseburger
- Mediterranean: Greek Mediterranean Salad