اعطني تطبيق مكتوب باستخدام React Native الاصدار 0.75 و expo الهدف منه حجز موعد مع طبيب، الصفحة الرئيسية تحتوي على header فيه معلومات عن الطبيب مثل اسمه وتخصصه وعنوانه ووقت العمل وزر حجز ويحتوي على ايقونة حجز وقسم آخر يحتوي على حجوزات المراجع النشطة وقسم تخصصات الطبيب، مثل قلع سن وحشوة سن والخ.. وكل تخصص موجود داخل بطاقة تحتوي على صورة كبيرة وعنوان التخصص وسعر بالدينار العراقي وزر حجز، الزر والسعر على نفس المستوى، السعر من يمين والزر من يسار ويحتوي على ايقونة. وصفحة اخرى تحتوي على قسمين، الاول المراجعات النشطة بجانب العنوان ايقونة ساعة، والثاني المراجعات السابقة وبجانب العنوان ايقونة سهم منتهي صلاحية. وهذه الصفحتين موجودتان في قائمة سفلية مثل قائمة يوتيوب وتحتوي على ايقونات الرئيسية وحجز. وصفحة ثالثة عند النقر على زر حجز تظهر وهي قائمة تحتوي على معلومات عن مراجع، مثل اسمه ورقم هاتف وتاريخ الحجز المطلوب ونوع الحجز (الذي يتم تحديده عند النقر على زر حجز من بطاقات، أو بشكل تلقائي، وهي عبارة عن خانة اختيار منسدلة من زر header). قم بكتابة اكواد بشكل منظم جيداً ومفهوم ويركز على اداء وسهل صيانة. واستخدم api هذا https://dc.me/api الرابط هذا وهمي. ضع الكثير من البيانات الوهمية للتجربة، خصوصا في حجوزات السابقة. ضع اكثر من 10 حجوزات. وضع كل شيء في ملف app.jsx واجعل التصميم يدعم الوضع الليلي والعادي حسب نمط الجهاز، واجعله متوافق مع اندرويد، واجعل التصميم مثل تصميمات dapp أو web3
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Creating a comprehensive React Native application as per your specifications involves several steps. Below is a complete implementation using React Native 0.75, Expo, and other essential libraries. This application includes:
Navigation: Using @react-navigation/native and @react-navigation/bottom-tabs for bottom tab navigation.
Theming: Supporting both Light and Dark modes using React Native's useColorScheme.
Mock Data: Utilizing mock data for doctor information, specialties, and bookings.
UI Components: Structured components for the header, specialties, bookings, and reviews.
State Management: Using React's useState and useEffect hooks to manage state and mock API calls.
Prerequisites
Before you begin, ensure you have the following installed:
Node.js (v14 or later)
Expo CLI: Install globally using npm install -g expo-cli
Setup Instructions
Initialize a New Expo Project
bash
expo init DoctorAppointmentApp
cd DoctorAppointmentApp
DarkThemeCustom and DefaultThemeCustom: Custom themes extending React Navigation's default themes to adjust colors as needed.
Navigation Setup:
Using a Bottom Tab Navigator with three tabs:
الرئيسية (Home)
حجوزاتي (Bookings)
مراجعات (Reviews)
Each tab has an associated icon from @expo/vector-icons.
Home Screen (HomeScreen):
Header: Displays doctor's information and a booking button.
Active Bookings: Shows a list of active bookings.
Specialties: Displays doctor specialties in cards with images, titles, prices, and a booking button.
Booking Modal: When the booking button is pressed, a modal appears allowing the user to input booking details.
Bookings Screen (BookingsScreen):
Active Bookings: Lists current active bookings with relevant details.
Previous Bookings: Lists past bookings.
Reviews Screen (ReviewsScreen):
Customization and Further Enhancements
API Integration: Replace mock data and alert dialogs with actual API calls to handle bookings and fetch real data.
Form Validation: Implement validation for input fields in the booking modal to ensure data integrity.
Dropdown for Booking Type: Enhance the booking modal by replacing the free text input for the booking type with a dropdown selector populated from SPECIALTIES.
Localization: Ensure all text aligns with the desired language and consider supporting multiple languages if needed.
Responsive Design: Further optimize the layout for different screen sizes and orientations.
Performance Optimization: Implement lazy loading for images and optimize list rendering with React.memo or similar techniques if necessary.
Running the App
After replacing the App.js with the provided code and installing all dependencies, run the app using:
bash
expo start
You can then use the Expo Go app on your Android device or an emulator to view and interact with the application.
This implementation provides a solid foundation based on your requirements. You can further expand and customize it to fit additional needs or integrate with backend services as necessary.
Active Reviews and Previous Reviews: Similar to bookings but intended for user feedback. Currently, it uses the same mock data as bookings for demonstration.
Booking Modal (BookingModal):
A modal that appears when booking a specialization.
Contains input fields for the patient's name, phone number, booking date, and type.
Has "حجز" (Book) and "إلغاء" (Cancel) buttons.
Styles:
Organized using React Native's StyleSheet for consistency and maintainability.
Styles adjust based on the current theme (light or dark).