diff --git a/docs/examples/.DS_Store b/docs/examples/.DS_Store deleted file mode 100644 index 412e740..0000000 Binary files a/docs/examples/.DS_Store and /dev/null differ diff --git a/docs/examples/appointment-scheduler/.firebaserc b/docs/examples/appointment-scheduler/.firebaserc deleted file mode 100644 index b99b50b..0000000 --- a/docs/examples/appointment-scheduler/.firebaserc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "projects": { - "default": "code-collator" - } -} diff --git a/docs/examples/appointment-scheduler/.gitignore b/docs/examples/appointment-scheduler/.gitignore deleted file mode 100644 index 3e73a2d..0000000 --- a/docs/examples/appointment-scheduler/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -node_modules/ -.expo/ -dist/ -npm-debug.* -*.jks -*.p8 -*.p12 -*.key -*.mobileprovision -*.orig.* -web-build/ - -# macOS -.DS_Store - -# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb -# The following patterns were generated by expo-cli - -expo-env.d.ts -# @end expo-cli - -package-lock.json \ No newline at end of file diff --git a/docs/examples/appointment-scheduler/README.md b/docs/examples/appointment-scheduler/README.md deleted file mode 100644 index cd4feb8..0000000 --- a/docs/examples/appointment-scheduler/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Welcome to your Expo app 👋 - -This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app). - -## Get started - -1. Install dependencies - - ```bash - npm install - ``` - -2. Start the app - - ```bash - npx expo start - ``` - -In the output, you'll find options to open the app in a - -- [development build](https://docs.expo.dev/develop/development-builds/introduction/) -- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/) -- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/) -- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo - -You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction). - -## Get a fresh project - -When you're ready, run: - -```bash -npm run reset-project -``` - -This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing. - -## Learn more - -To learn more about developing your project with Expo, look at the following resources: - -- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides). -- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web. - -## Join the community - -Join our community of developers creating universal apps. - -- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute. -- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions. diff --git a/docs/examples/appointment-scheduler/app.json b/docs/examples/appointment-scheduler/app.json deleted file mode 100644 index 462652b..0000000 --- a/docs/examples/appointment-scheduler/app.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "expo": { - "name": "appointment-scheduler", - "slug": "appointment-scheduler", - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/images/icon.png", - "scheme": "myapp", - "userInterfaceStyle": "automatic", - "splash": { - "image": "./assets/images/splash.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "ios": { - "supportsTablet": true - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/images/adaptive-icon.png", - "backgroundColor": "#ffffff" - } - }, - "web": { - "bundler": "metro", - "output": "static", - "favicon": "./assets/images/favicon.png" - }, - "plugins": [ - "expo-router" - ], - "experiments": { - "typedRoutes": true - } - } -} diff --git a/docs/examples/appointment-scheduler/app/(tabs)/_layout.tsx b/docs/examples/appointment-scheduler/app/(tabs)/_layout.tsx deleted file mode 100644 index e6b49b2..0000000 --- a/docs/examples/appointment-scheduler/app/(tabs)/_layout.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import FontAwesome from '@expo/vector-icons/FontAwesome'; -import { Tabs } from 'expo-router'; -import { useColorScheme } from 'react-native'; - -import Colors from '@/constants/Colors'; - -function TabBarIcon(props: { - name: React.ComponentProps['name']; - color: string; -}) { - return ; -} - -export default function TabLayout() { - const colorScheme = useColorScheme(); - - return ( - - , - }} - /> - , - }} - /> - , - }} - /> - - ); -} \ No newline at end of file diff --git a/docs/examples/appointment-scheduler/app/(tabs)/appointments.tsx b/docs/examples/appointment-scheduler/app/(tabs)/appointments.tsx deleted file mode 100644 index 46fc518..0000000 --- a/docs/examples/appointment-scheduler/app/(tabs)/appointments.tsx +++ /dev/null @@ -1,149 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { StyleSheet, ScrollView, Button, Alert, FlatList } from 'react-native'; -import { Calendar } from 'react-native-calendars'; -import { collection, addDoc, query, where, getDocs, deleteDoc, doc } from 'firebase/firestore'; -import { auth, db } from '../../firebaseConfig'; - -import { Text, View } from '@/components/Themed'; - -const TIME_SLOTS = [ - '09:00', '10:00', '11:00', '12:00', '14:00', '15:00', '16:00', '17:00' -]; - -export default function AppointmentsScreen() { - const [selected, setSelected] = useState(''); - const [availableSlots, setAvailableSlots] = useState(TIME_SLOTS); - const [userAppointments, setUserAppointments] = useState([]); - - useEffect(() => { - if (selected) { - fetchBookedSlots(); - } - fetchUserAppointments(); - }, [selected]); - - const fetchBookedSlots = async () => { - const appointmentsRef = collection(db, 'appointments'); - const q = query(appointmentsRef, where('date', '==', selected)); - const querySnapshot = await getDocs(q); - const bookedSlots = querySnapshot.docs.map(doc => doc.data().time); - setAvailableSlots(TIME_SLOTS.filter(slot => !bookedSlots.includes(slot))); - }; - - const fetchUserAppointments = async () => { - if (auth.currentUser) { - const appointmentsRef = collection(db, 'appointments'); - const q = query(appointmentsRef, where('userId', '==', auth.currentUser.uid)); - const querySnapshot = await getDocs(q); - const appointments = querySnapshot.docs.map(doc => ({ - id: doc.id, - ...doc.data() - })); - setUserAppointments(appointments); - } - }; - - const bookAppointment = async (time: string) => { - try { - await addDoc(collection(db, 'appointments'), { - userId: auth.currentUser?.uid, - date: selected, - time: time, - }); - Alert.alert('Success', 'Appointment booked successfully!'); - fetchBookedSlots(); - fetchUserAppointments(); - } catch (error) { - Alert.alert('Error', 'Failed to book appointment. Please try again.'); - } - }; - - const cancelAppointment = async (appointmentId: string) => { - try { - await deleteDoc(doc(db, 'appointments', appointmentId)); - Alert.alert('Success', 'Appointment cancelled successfully!'); - fetchUserAppointments(); - } catch (error) { - Alert.alert('Error', 'Failed to cancel appointment. Please try again.'); - } - }; - - const renderAppointment = ({ item }) => ( - - {`Date: ${item.date}, Time: ${item.time}`} -