Component Architecture
The Bİ DOLU İÇECEK application is built with a modular React architecture, featuring reusable components that handle product display, cart management, order processing, and user interactions.Core Components
The application consists of several key component types:Product Card
Interactive product cards that display products and trigger modals for detailed options
Product Modal
Full-screen modal for viewing and adding sub-products to cart with quantity controls
Order Button
Smart floating order button with service hours validation and WhatsApp integration
Cart Context
Global state management for shopping cart with React Context API
Component Hierarchy
State Management
The application uses React Context API for global state management:- CartContext: Manages shopping cart state, items, quantities, and cart operations
- Local State: Components manage their own UI state (modals, loading states, etc.)
Key Features
Product Display
- ProductCard: Clickable cards with hover effects and accessibility support
- ProductImage: Lazy-loaded images with fallback placeholders and loading indicators
- ProductModal: Full-screen modal with sub-product grid and cart integration
Cart Management
- Add/Remove Items: Quantity controls with increment/decrement buttons
- Real-time Updates: Cart state updates instantly across all components
- Price Calculation: Automatic total calculation with Turkish Lira formatting
Business Logic Integration
- Service Hours: Components respect configured service hours (8:30-20:30)
- Damacana Limits: Special restrictions for damacana products (cutoff at 19:00)
- Minimum Order: 400 TL minimum order validation
- WhatsApp Integration: Direct order placement via WhatsApp
Styling Approach
CSS Architecture
The application uses a combination of:- Custom CSS Classes: Component-specific styles in
App.css - Tailwind Utilities: Inline utility classes for layout and responsive design
- CSS Transitions: Smooth animations for hover states and interactions
Responsive Design
All components are fully responsive:Accessibility
Components follow accessibility best practices:- Keyboard Navigation: All interactive elements support keyboard input (Enter, Space)
- ARIA Labels: Descriptive labels for screen readers
- Focus States: Clear visual focus indicators
- Semantic HTML: Proper use of buttons, roles, and tabindex
Component Communication
Props Flow
Context Usage
Next Steps
Explore individual component documentation for detailed props, methods, and usage examples:ProductCard Component
Learn how to use and customize product cards
ProductModal Component
Understand modal functionality and sub-product handling
OrderButton Component
Integrate order validation and WhatsApp messaging
CartContext & useCart
Master cart state management with Context API