diff --git a/xtablo-expo/app/(auth)/login.tsx b/xtablo-expo/app/(auth)/login.tsx index 2bd8a4f..776b506 100644 --- a/xtablo-expo/app/(auth)/login.tsx +++ b/xtablo-expo/app/(auth)/login.tsx @@ -17,7 +17,7 @@ export default function Auth() { return ( - + Connexion XTablo Connectez-vous à votre compte diff --git a/xtablo-expo/app/(auth)/signup.tsx b/xtablo-expo/app/(auth)/signup.tsx index 08173ff..c15a983 100644 --- a/xtablo-expo/app/(auth)/signup.tsx +++ b/xtablo-expo/app/(auth)/signup.tsx @@ -17,7 +17,7 @@ export default function SignUp() { return ( - + Créer un compte XTablo Rejoignez-nous ! diff --git a/xtablo-expo/app/(home)/(tabs)/_layout.tsx b/xtablo-expo/app/(home)/(tabs)/_layout.tsx index 00c0914..1b1d89f 100644 --- a/xtablo-expo/app/(home)/(tabs)/_layout.tsx +++ b/xtablo-expo/app/(home)/(tabs)/_layout.tsx @@ -5,7 +5,7 @@ import { HapticTab } from "@/components/HapticTab"; import TabBarBackground from "@/components/ui/TabBarBackground"; import { Colors } from "@/constants/Colors"; import { useColorScheme } from "@/hooks/useColorScheme"; -import { Home, User } from "lucide-react-native"; +import { MessageCircle, Calendar, User } from "lucide-react-native"; export default function TabLayout() { const colorScheme = useColorScheme(); @@ -13,7 +13,7 @@ export default function TabLayout() { , + title: "Discussions", + tabBarIcon: ({ size, color }) => ( + + ), + }} + /> + ( + + ), }} /> { + // Format date as YYYY-MM-DD using local time (avoiding timezone issues) + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, "0"); + const day = String(date.getDate()).padStart(2, "0"); + console.log({ year, month, day }); + return `${year}-${month}-${day}`; +}; + +export default function PlanningScreen() { + const [selectedDate, setSelectedDate] = useState(new Date()); + const [currentMonth, setCurrentMonth] = useState(new Date()); + const [showTabloSelector, setShowTabloSelector] = useState(false); + const [selectedTablo, setSelectedTablo] = useState(null); + const [viewMode, setViewMode] = useState("month"); + const [showCreateEventModal, setShowCreateEventModal] = useState(false); + const [newEvent, setNewEvent] = useState>({ + title: "", + start_date: getDateFormatted(new Date()), + start_time: "09:00", + tablo_id: "", + }); + const { data: events } = useEventsByTablo(null); + const { data: tablos } = useTablosList(); + const createEvent = useCreateEvent(); + + const filteredEvents: EventAndTablo[] = + (selectedTablo === null + ? events + : events?.filter((event) => event.tablo_id === selectedTablo.id)) || []; + + const generateCalendarDays = () => { + const year = currentMonth.getFullYear(); + const month = currentMonth.getMonth(); + const firstDay = new Date(year, month, 1); + const lastDay = new Date(year, month + 1, 0); + const startDate = new Date(firstDay); + startDate.setDate(startDate.getDate() - firstDay.getDay() + 1); + + const days = []; + for (let i = 0; i < 42; i++) { + const date = new Date(startDate); + date.setDate(startDate.getDate() + i); + days.push(date); + } + return days; + }; + + const generateWeekDays = () => { + const startOfWeek = new Date(selectedDate); + const day = startOfWeek.getDay(); + const diff = startOfWeek.getDate() - day + (day === 0 ? -6 : 1); // Adjust when day is Sunday + startOfWeek.setDate(diff); + + const days = []; + for (let i = 0; i < 7; i++) { + const date = new Date(startOfWeek); + date.setDate(startOfWeek.getDate() + i); + days.push(date); + } + return days; + }; + + const navigateMonth = (direction: "prev" | "next") => { + const newDate = new Date(currentMonth); + newDate.setMonth(currentMonth.getMonth() + (direction === "next" ? 1 : -1)); + setCurrentMonth(newDate); + }; + + const navigateWeek = (direction: "prev" | "next") => { + const newDate = new Date(selectedDate); + newDate.setDate(selectedDate.getDate() + (direction === "next" ? 7 : -7)); + setSelectedDate(newDate); + }; + + const isToday = (date: Date) => { + const today = new Date(); + return date.toDateString() === today.toDateString(); + }; + + const isCurrentMonth = (date: Date) => { + return date.getMonth() === currentMonth.getMonth(); + }; + + const isSelected = (date: Date) => { + return date.toDateString() === selectedDate.toDateString(); + }; + + const getEventsForDate = (date: Date) => { + const dateString = date.toISOString().split("T")[0]; + return filteredEvents.filter((event) => event.start_date === dateString); + }; + + const selectTablo = (tablo: UserTablo | null) => { + setSelectedTablo(tablo); + setShowTabloSelector(false); + }; + + const openCreateEventModal = () => { + setNewEvent({ + title: "", + start_date: getDateFormatted(selectedDate), + start_time: "09:00", + tablo_id: selectedTablo?.id || "", + }); + setShowCreateEventModal(true); + }; + + const handleCreateEvent = () => { + if (!newEvent.title.trim()) { + Alert.alert("Erreur", "Veuillez saisir un titre pour l'événement"); + return; + } + if (!newEvent.tablo_id) { + Alert.alert("Erreur", "Veuillez sélectionner un tablo"); + return; + } + console.log({ newEvent }); + createEvent({ + ...newEvent, + start_date: newEvent.start_date, + start_time: newEvent.start_time, + }); + setShowCreateEventModal(false); + }; + + const colorMap: Record = { + "bg-blue-500": "#3b82f6", + "bg-green-500": "#10b981", + "bg-red-500": "#ef4444", + "bg-yellow-500": "#f59e0b", + "bg-purple-500": "#8b5cf6", + "bg-pink-500": "#ec4899", + "bg-gray-500": "#6b7280", + "bg-orange-500": "#f5100b", + "bg-teal-500": "#0d9488", + "bg-indigo-500": "#6366f1", + "bg-lime-500": "#84cc16", + "bg-emerald-500": "#10b981", + "bg-cyan-500": "#06b6d4", + "bg-fuchsia-500": "#d946ef", + }; + + const renderTabloOption = ({ item }: { item: UserTablo }) => ( + selectTablo(item)} + > + + + + {item.name} + + + {selectedTablo?.id === item.id && } + + ); + + const renderEvent = ({ item }: { item: EventAndTablo }) => ( + + + + {item.title} + + + + + {item.start_time?.substring(0, 5)} + + + + + {item.tablo_name} + + + + + ); + + const renderCalendarDay = (date: Date, index: number) => ( + setSelectedDate(date)} + > + + {date.getDate()} + + {getEventsForDate(date).length > 0 && } + + ); + + const renderWeekDay = (date: Date, index: number) => { + const dayEvents = getEventsForDate(date); + + return ( + + setSelectedDate(date)} + > + + {daysOfWeek[index]} + + + {date.getDate()} + + + + + {/* Circle indicators for all days */} + + {dayEvents.slice(0, 6).map((event, eventIndex) => ( + + ))} + {dayEvents.length > 6 && ( + + + +{dayEvents.length - 6} + + + )} + + + + ); + }; + + const renderSelectedDayEvents = () => { + const selectedDayEvents = getEventsForDate(selectedDate); + + return ( + + + + {selectedDate.toLocaleDateString("fr-FR", { + weekday: "long", + day: "numeric", + month: "long", + })} + + + {selectedDayEvents.length} événement + {selectedDayEvents.length > 1 ? "s" : ""} + + + + {selectedDayEvents.length > 0 ? ( + item.event_id} + scrollEnabled={false} + showsVerticalScrollIndicator={false} + contentContainerStyle={styles.selectedDayEventsList} + /> + ) : ( + + + Aucun événement + + Vous n'avez aucun événement prévu pour cette date. + + + )} + + ); + }; + + const calendarDays = generateCalendarDays(); + const weekDays = generateWeekDays(); + const todayEvents = getEventsForDate(selectedDate); + + return ( + + {/* Header */} + + + Planning + + {viewMode === "month" + ? months[currentMonth.getMonth()] + + " " + + currentMonth.getFullYear() + : selectedDate.toLocaleDateString("fr-FR", { + weekday: "long", + year: "numeric", + month: "long", + day: "numeric", + })} + + + + + + + + {/* View Mode Toggle */} + + + setViewMode("month")} + > + + + Mois + + + setViewMode("week")} + > + + + Semaine + + + + + + {/* Tablo Selector */} + + setShowTabloSelector(true)} + > + + + + Tablo actuel + + + + {selectedTablo?.name ?? "Tous les tablos"} + + + + + + + + + {/* Calendar/Week View */} + + + + viewMode === "month" + ? navigateMonth("prev") + : navigateWeek("prev") + } + > + + + + {viewMode === "month" + ? `${ + months[currentMonth.getMonth()] + } ${currentMonth.getFullYear()}` + : `Semaine du ${weekDays[0].getDate()} ${ + months[weekDays[0].getMonth()] + }`} + + + viewMode === "month" + ? navigateMonth("next") + : navigateWeek("next") + } + > + + + + + {viewMode === "month" ? ( + <> + + {daysOfWeek.map((day, i) => ( + + {day} + + ))} + + + + {calendarDays.map((date, index) => + renderCalendarDay(date, index) + )} + + + ) : ( + <> + + {weekDays.map((date, index) => renderWeekDay(date, index))} + + {renderSelectedDayEvents()} + + )} + + + {/* Today's Events (only shown in month view) */} + {viewMode === "month" && ( + + + + + Événements du jour ({todayEvents.length}) + + + + {todayEvents.length > 0 ? ( + item.event_id} + scrollEnabled={false} + showsVerticalScrollIndicator={false} + /> + ) : ( + + + Aucun événement + + Vous n'avez aucun événement prévu pour cette date. + + + )} + + )} + + {/* Tablo Selector Modal */} + setShowTabloSelector(false)} + > + setShowTabloSelector(false)} + > + + + Choisir un tablo + + item.id} + showsVerticalScrollIndicator={false} + ListHeaderComponent={ + selectTablo(null)} + > + + + + + Tous les tablos + + + + {selectedTablo === null && ( + + )} + + } + /> + + + + + setShowCreateEventModal(false)} + > + + + + Nouvel événement + setShowCreateEventModal(false)} + style={styles.createEventCloseButton} + > + + + + + + {/* Title Field */} + + Titre * + + setNewEvent({ ...newEvent, title: text }) + } + placeholder="Titre de l'événement" + placeholderTextColor="#9ca3af" + /> + + + {/* Date Field */} + + Date + + setNewEvent({ ...newEvent, start_date: text }) + } + placeholder="YYYY-MM-DD" + placeholderTextColor="#9ca3af" + /> + + + {/* Time Field */} + + Heure + + setNewEvent({ ...newEvent, start_time: text }) + } + placeholder="HH:MM" + placeholderTextColor="#9ca3af" + /> + + + {/* Tablo Selector */} + + Tablo * + ( + + setNewEvent({ ...newEvent, tablo_id: item.id }) + } + > + + + + {item.name} + + + {newEvent.tablo_id === item.id && ( + + )} + + )} + keyExtractor={(item) => item.id} + showsVerticalScrollIndicator={false} + scrollEnabled={false} + style={styles.tabloListInForm} + /> + + + + + setShowCreateEventModal(false)} + > + Annuler + + + + Enregistrer + + + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: "#f8fafc", + }, + header: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + paddingHorizontal: 20, + paddingTop: 60, + paddingBottom: 20, + }, + headerTitle: { + fontSize: 28, + fontWeight: "bold", + color: "#1f2937", + marginBottom: 4, + }, + headerSubtitle: { + fontSize: 16, + color: "#6b7280", + textTransform: "capitalize", + }, + addButton: { + width: 48, + height: 48, + borderRadius: 24, + backgroundColor: "#3b82f6", + justifyContent: "center", + alignItems: "center", + shadowColor: "#3b82f6", + shadowOffset: { width: 0, height: 4 }, + shadowOpacity: 0.3, + shadowRadius: 8, + elevation: 6, + }, + viewModeContainer: { + paddingHorizontal: 20, + marginBottom: 20, + }, + viewModeToggle: { + flexDirection: "row", + backgroundColor: "#f3f4f6", + borderRadius: 12, + padding: 4, + }, + viewModeButton: { + flex: 1, + flexDirection: "row", + alignItems: "center", + justifyContent: "center", + paddingVertical: 8, + paddingHorizontal: 12, + borderRadius: 8, + gap: 6, + }, + activeViewModeButton: { + backgroundColor: "#3b82f6", + }, + viewModeText: { + fontSize: 14, + fontWeight: "500", + color: "#6b7280", + }, + activeViewModeText: { + color: "white", + }, + tabloSelectorContainer: { + paddingHorizontal: 20, + marginBottom: 20, + }, + tabloSelector: { + backgroundColor: "white", + borderRadius: 12, + padding: 16, + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + shadowColor: "#000", + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.1, + shadowRadius: 4, + elevation: 3, + }, + tabloSelectorLeft: { + flexDirection: "row", + alignItems: "center", + flex: 1, + }, + tabloSelectorContent: { + marginLeft: 12, + flex: 1, + }, + tabloSelectorLabel: { + fontSize: 12, + color: "#6b7280", + marginBottom: 2, + }, + tabloSelectorRow: { + flexDirection: "row", + alignItems: "center", + }, + tabloSelectorName: { + fontSize: 16, + fontWeight: "600", + color: "#1f2937", + marginLeft: 8, + }, + tabloColorDot: { + width: 12, + height: 12, + borderRadius: 6, + }, + calendarCard: { + marginHorizontal: 20, + marginBottom: 20, + borderRadius: 16, + padding: 20, + shadowColor: "#000", + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.1, + shadowRadius: 8, + elevation: 4, + borderWidth: 0, + }, + calendarHeader: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + marginBottom: 20, + }, + calendarTitle: { + fontSize: 18, + fontWeight: "600", + color: "#1f2937", + }, + weekHeader: { + flexDirection: "row", + justifyContent: "space-around", + marginBottom: 16, + paddingBottom: 12, + borderBottomWidth: 1, + borderBottomColor: "#e5e7eb", + }, + weekDay: { + fontSize: 14, + fontWeight: "500", + color: "#6b7280", + textAlign: "center", + width: 40, + }, + calendarGrid: { + flexDirection: "row", + flexWrap: "wrap", + }, + dayContainer: { + width: "14.28%", + height: 40, + justifyContent: "center", + alignItems: "center", + position: "relative", + }, + dayText: { + fontSize: 16, + color: "#1f2937", + fontWeight: "500", + }, + inactiveDayText: { + color: "#d1d5db", + }, + selectedDay: { + backgroundColor: "#3b82f6", + borderRadius: 20, + }, + selectedDayText: { + color: "white", + fontWeight: "600", + }, + todaySelectedDay: { + backgroundColor: "#f5100b", + }, + todayDay: { + backgroundColor: "#fef3c7", + borderRadius: 20, + }, + todayDayText: { + color: "#f59e0b", + fontWeight: "600", + }, + todaySelectedDayText: { + color: "white", + fontWeight: "600", + }, + eventDot: { + position: "absolute", + bottom: 4, + width: 6, + height: 6, + borderRadius: 3, + backgroundColor: "#ef4444", + }, + // Week View Styles + weekView: { + flexDirection: "row", + height: 100, + }, + weekDayColumn: { + flex: 1, + marginHorizontal: 2, + }, + weekDayHeader: { + backgroundColor: "#f8fafc", + borderRadius: 8, + padding: 8, + alignItems: "center", + marginBottom: 8, + }, + selectedWeekDay: { + backgroundColor: "#3b82f6", + }, + todaySelectedWeekDay: { + backgroundColor: "#f5100b", + }, + todayWeekDay: { + backgroundColor: "#fef3c7", + }, + weekDayName: { + fontSize: 12, + color: "#6b7280", + fontWeight: "500", + }, + weekDayNumber: { + fontSize: 16, + color: "#1f2937", + fontWeight: "600", + marginTop: 2, + }, + selectedWeekDayText: { + color: "white", + }, + todayWeekDayText: { + color: "#f59e0b", + }, + todaySelectedWeekDayText: { + color: "white", + }, + weekDayEvents: { + flex: 1, + }, + weekEventCard: { + backgroundColor: "white", + borderRadius: 6, + marginBottom: 4, + flexDirection: "row", + shadowColor: "#000", + shadowOffset: { width: 0, height: 1 }, + shadowOpacity: 0.1, + shadowRadius: 2, + elevation: 2, + }, + weekEventBar: { + width: 3, + borderTopLeftRadius: 6, + borderBottomLeftRadius: 6, + }, + weekEventContent: { + flex: 1, + padding: 8, + }, + weekEventTitle: { + fontSize: 11, + fontWeight: "600", + color: "#1f2937", + marginBottom: 2, + }, + weekEventTime: { + fontSize: 7, + color: "#6b7280", + }, + weekEventTablo: { + fontSize: 10, + color: "#6b7280", + marginTop: 2, + }, + weekEventCircles: { + flexDirection: "row", + flexWrap: "wrap", + justifyContent: "center", + alignItems: "center", + marginTop: 4, + }, + weekEventCircle: { + width: 10, + height: 10, + borderRadius: 5, + margin: 2, + }, + weekEventMoreCircle: { + width: 20, + height: 20, + borderRadius: 10, + backgroundColor: "#e5e7eb", + justifyContent: "center", + alignItems: "center", + margin: 2, + }, + weekEventMoreText: { + fontSize: 10, + color: "#6b7280", + }, + weekEmptySlot: { + flex: 1, + justifyContent: "center", + alignItems: "center", + opacity: 0.5, + }, + weekEmptyText: { + fontSize: 10, + color: "#9ca3af", + textAlign: "center", + }, + eventsSection: { + paddingHorizontal: 20, + paddingBottom: 40, + }, + eventsSectionHeader: { + flexDirection: "row", + alignItems: "center", + marginBottom: 16, + }, + eventsSectionTitle: { + fontSize: 18, + fontWeight: "600", + color: "#1f2937", + marginLeft: 8, + }, + eventCard: { + backgroundColor: "white", + borderRadius: 12, + marginBottom: 12, + flexDirection: "row", + shadowColor: "#000", + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.1, + shadowRadius: 4, + elevation: 3, + }, + eventColorBar: { + width: 4, + borderTopLeftRadius: 12, + borderBottomLeftRadius: 12, + }, + eventContent: { + flex: 1, + padding: 16, + }, + eventTitle: { + fontSize: 16, + fontWeight: "600", + color: "#1f2937", + marginBottom: 8, + }, + eventDetails: { + gap: 6, + }, + eventDetailItem: { + flexDirection: "row", + alignItems: "center", + gap: 6, + }, + eventDetailText: { + fontSize: 14, + color: "#6b7280", + }, + emptyState: { + display: "flex", + flexDirection: "column", + alignItems: "center", + padding: 40, + borderRadius: 12, + borderWidth: 0, + }, + emptyStateTitle: { + fontSize: 18, + fontWeight: "600", + color: "#6b7280", + marginTop: 8, + marginBottom: 8, + }, + emptyStateText: { + fontSize: 14, + color: "#9ca3af", + textAlign: "center", + lineHeight: 20, + }, + modalOverlay: { + flex: 1, + backgroundColor: "rgba(0, 0, 0, 0.5)", + justifyContent: "center", + alignItems: "center", + paddingHorizontal: 20, + }, + modalContent: { + backgroundColor: "white", + borderRadius: 16, + width: "100%", + maxWidth: 400, + maxHeight: "70%", + shadowColor: "#000", + shadowOffset: { width: 0, height: 10 }, + shadowOpacity: 0.25, + shadowRadius: 20, + elevation: 10, + }, + modalHeader: { + padding: 20, + borderBottomWidth: 1, + borderBottomColor: "#e5e7eb", + }, + modalTitle: { + fontSize: 18, + fontWeight: "600", + color: "#1f2937", + textAlign: "center", + }, + tabloOption: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + padding: 16, + borderBottomWidth: 1, + borderBottomColor: "#f3f4f6", + }, + tabloOptionLeft: { + flexDirection: "row", + alignItems: "center", + flex: 1, + }, + tabloOptionContent: { + marginLeft: 12, + flex: 1, + }, + tabloOptionName: { + fontSize: 16, + fontWeight: "500", + color: "#1f2937", + marginBottom: 2, + }, + tabloOptionCount: { + fontSize: 12, + color: "#6b7280", + }, + selectedWeekDayColumn: { + flex: 1, // Make selected day column wider + }, + selectedDayEventsContainer: { + marginTop: 8, + paddingHorizontal: 10, + }, + selectedDayHeader: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + marginBottom: 12, + }, + selectedDayTitle: { + fontSize: 18, + fontWeight: "600", + color: "#1f2937", + }, + selectedDayEventsCount: { + fontSize: 14, + color: "#6b7280", + }, + selectedDayEventsList: { + paddingBottom: 10, + }, + selectedDayEmptyState: { + alignItems: "center", + padding: 40, + borderRadius: 12, + borderWidth: 0, + }, + // Create Event Modal Styles + createEventModalOverlay: { + flex: 1, + backgroundColor: "rgba(0, 0, 0, 0.5)", + justifyContent: "flex-end", + }, + createEventModalContent: { + backgroundColor: "white", + borderTopLeftRadius: 20, + borderTopRightRadius: 20, + maxHeight: "90%", + shadowColor: "#000", + shadowOffset: { width: 0, height: -5 }, + shadowOpacity: 0.25, + shadowRadius: 20, + elevation: 10, + }, + createEventModalHeader: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + padding: 20, + borderBottomWidth: 1, + borderBottomColor: "#e5e7eb", + }, + createEventModalTitle: { + fontSize: 20, + fontWeight: "600", + color: "#1f2937", + }, + createEventCloseButton: { + padding: 4, + }, + createEventForm: { + padding: 20, + maxHeight: 400, + }, + formField: { + marginBottom: 20, + }, + formLabel: { + fontSize: 16, + fontWeight: "500", + color: "#374151", + marginBottom: 8, + }, + formInput: { + borderWidth: 1, + borderColor: "#d1d5db", + borderRadius: 8, + padding: 12, + fontSize: 16, + color: "#1f2937", + backgroundColor: "white", + }, + tabloListInForm: { + borderWidth: 1, + borderColor: "#d1d5db", + borderRadius: 8, + backgroundColor: "white", + maxHeight: 150, + }, + tabloOptionInForm: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + padding: 12, + borderBottomWidth: 1, + borderBottomColor: "#f3f4f6", + }, + selectedTabloOptionInForm: { + backgroundColor: "#eff6ff", + }, + tabloOptionNameInForm: { + fontSize: 16, + fontWeight: "500", + color: "#1f2937", + marginLeft: 8, + }, + selectedTabloOptionNameInForm: { + color: "#3b82f6", + }, + createEventModalActions: { + flexDirection: "row", + justifyContent: "space-between", + padding: 20, + borderTopWidth: 1, + borderTopColor: "#e5e7eb", + gap: 12, + }, + cancelButton: { + flex: 1, + paddingVertical: 12, + paddingHorizontal: 20, + borderRadius: 8, + borderWidth: 1, + borderColor: "#d1d5db", + alignItems: "center", + justifyContent: "center", + }, + cancelButtonText: { + fontSize: 16, + fontWeight: "500", + color: "#6b7280", + }, + saveButton: { + flex: 1, + flexDirection: "row", + paddingVertical: 12, + paddingHorizontal: 20, + borderRadius: 8, + backgroundColor: "#3b82f6", + alignItems: "center", + justifyContent: "center", + gap: 8, + }, + saveButtonText: { + fontSize: 16, + fontWeight: "500", + color: "white", + }, +}); diff --git a/xtablo-expo/app/(home)/(tabs)/profile.tsx b/xtablo-expo/app/(home)/(tabs)/profile.tsx index e885189..dd38091 100644 --- a/xtablo-expo/app/(home)/(tabs)/profile.tsx +++ b/xtablo-expo/app/(home)/(tabs)/profile.tsx @@ -1,9 +1,25 @@ -import { View, StyleSheet } from "react-native"; +import { + View, + StyleSheet, + ScrollView, + Text, + TouchableOpacity, +} from "react-native"; import { useAuth } from "@/stores/auth"; -import { Avatar, Button, Input } from "@rn-vui/themed"; -import { Card, ListItem } from "@rn-vui/themed"; +import { Avatar, Input } from "@rn-vui/themed"; +import { Card } from "@rn-vui/themed"; import { useState } from "react"; import { useUser } from "@/providers/UserProvider"; +import { LinearGradient } from "expo-linear-gradient"; +import { + User, + Mail, + Edit3, + Check, + LogOut, + Settings, + Shield, +} from "lucide-react-native"; export default function ProfileScreen() { const signOut = useAuth((state) => state.signOut); @@ -12,145 +28,334 @@ export default function ProfileScreen() { const [displayName, setDisplayName] = useState(user.name || ""); const [isEditing, setIsEditing] = useState(false); + const handleSaveDisplayName = () => { + // TODO: Implémenter la fonctionnalité de sauvegarde + setIsEditing(false); + }; + + const menuItems = [ + { + icon: Settings, + title: "Paramètres du compte", + subtitle: "Gérez vos préférences de compte", + onPress: () => console.log("Paramètres"), + }, + { + icon: Shield, + title: "Confidentialité et sécurité", + subtitle: "Contrôlez vos paramètres de confidentialité", + onPress: () => console.log("Confidentialité"), + }, + ]; + return ( - - - - - {user.name} - - - - - Email - - {user.email} - - - - - - - - Display Name - - {isEditing ? ( - - ) : ( - - {user.name || "Not Set"} - - )} - -