mirror of
https://github.com/urosran/cally.git
synced 2025-07-16 18:16:17 +00:00
Fix details/notes missing from events
This commit is contained in:
@ -72,12 +72,14 @@ export const AddEventDialog = () => {
|
||||
style={{marginTop: 20, alignItems: "center", width: "100%"}}
|
||||
>
|
||||
<Button
|
||||
disabled
|
||||
style={{
|
||||
marginBottom: 10,
|
||||
backgroundColor: "#ea156c",
|
||||
justifyContent: "center",
|
||||
width: "100%",
|
||||
paddingVertical: 13,
|
||||
opacity: 0.5
|
||||
}}
|
||||
label="Scan Image"
|
||||
labelStyle={styles.btnLabel}
|
||||
@ -104,12 +106,14 @@ export const AddEventDialog = () => {
|
||||
/>
|
||||
|
||||
<Button
|
||||
disabled
|
||||
style={{
|
||||
marginBottom: 10,
|
||||
backgroundColor: "#05a8b6",
|
||||
justifyContent: "center",
|
||||
width: "100%",
|
||||
paddingVertical: 13,
|
||||
opacity: 0.5
|
||||
}}
|
||||
label="Add To Do"
|
||||
labelStyle={styles.btnLabel}
|
||||
|
@ -50,6 +50,7 @@ export const EventCalendar: React.FC<EventCalendarProps> = React.memo(({calendar
|
||||
const handlePressEvent = useCallback((event: CalendarEvent) => {
|
||||
if (mode === "day") {
|
||||
setEditVisible(true);
|
||||
console.log({event})
|
||||
setEventForEdit(event);
|
||||
} else {
|
||||
setMode("day")
|
||||
|
@ -10,12 +10,13 @@ import {
|
||||
Switch,
|
||||
Text,
|
||||
TextField,
|
||||
TextFieldRef,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from "react-native-ui-lib";
|
||||
import {ScrollView} from "react-native-gesture-handler";
|
||||
import {useSafeAreaInsets} from "react-native-safe-area-context";
|
||||
import {useEffect, useState} from "react";
|
||||
import {useEffect, useRef, useState} from "react";
|
||||
import {AntDesign, Feather, Ionicons,} from "@expo/vector-icons";
|
||||
import {PickerMultiValue} from "react-native-ui-lib/src/components/picker/types";
|
||||
import {useCreateEvent} from "@/hooks/firebase/useCreateEvent";
|
||||
@ -57,7 +58,10 @@ export const ManuallyAddEventModal = () => {
|
||||
initialDate: selectedNewEventDate || editEvent?.start
|
||||
}
|
||||
|
||||
const detailsRef = useRef<TextFieldRef>(null)
|
||||
|
||||
const [title, setTitle] = useState<string>(editEvent?.title || "");
|
||||
const [details, setDetails] = useState<string>(editEvent?.notes || "");
|
||||
const [isAllDay, setIsAllDay] = useState(editEvent?.allDay || false);
|
||||
const [isPrivate, setIsPrivate] = useState<boolean>(editEvent?.private || false);
|
||||
const [startTime, setStartTime] = useState(() => {
|
||||
@ -87,6 +91,7 @@ export const ManuallyAddEventModal = () => {
|
||||
|
||||
useEffect(() => {
|
||||
setTitle(editEvent?.title || "");
|
||||
setDetails(editEvent?.notes || "");
|
||||
setIsAllDay(editEvent?.allDay || false);
|
||||
setIsPrivate(editEvent?.private || false);
|
||||
setStartTime(() => {
|
||||
@ -150,9 +155,11 @@ export const ManuallyAddEventModal = () => {
|
||||
endDate: finalEndDate,
|
||||
allDay: isAllDay,
|
||||
attendees: selectedAttendees,
|
||||
id: editEvent?.id
|
||||
notes: details
|
||||
};
|
||||
|
||||
if (editEvent?.id) eventData.id = editEvent?.id
|
||||
|
||||
await createEvent(eventData);
|
||||
|
||||
close();
|
||||
@ -253,7 +260,7 @@ export const ManuallyAddEventModal = () => {
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<ScrollView>
|
||||
<ScrollView style={{minHeight: "85%"}}>
|
||||
<TextField
|
||||
placeholder="Add event title"
|
||||
value={title}
|
||||
@ -414,7 +421,8 @@ export const ManuallyAddEventModal = () => {
|
||||
</View>
|
||||
|
||||
<View marginL-35>
|
||||
<AssigneesDisplay setSlectedAttendees={setSelectedAttendees} selectedAttendees={selectedAttendees}/>
|
||||
<AssigneesDisplay setSlectedAttendees={setSelectedAttendees}
|
||||
selectedAttendees={selectedAttendees}/>
|
||||
</View>
|
||||
|
||||
<View style={styles.divider}/>
|
||||
@ -476,7 +484,8 @@ export const ManuallyAddEventModal = () => {
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.divider}/>
|
||||
<View marginH-30 marginB-0 row spread centerV>
|
||||
<View marginH-30 marginB-0 spread centerV flex-1>
|
||||
<TouchableOpacity onPress={() => detailsRef?.current?.focus()}>
|
||||
<View row centerV>
|
||||
<MenuIcon/>
|
||||
<Text
|
||||
@ -489,7 +498,10 @@ export const ManuallyAddEventModal = () => {
|
||||
Add Details
|
||||
</Text>
|
||||
</View>
|
||||
<View></View>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TextField value={details} onChangeText={setDetails} ref={detailsRef} maxLength={2000} multiline
|
||||
numberOfLines={10} marginT-10 style={{flex: 1, minHeight: 180}}/>
|
||||
</View>
|
||||
</ScrollView>
|
||||
<Button
|
||||
|
@ -10,4 +10,5 @@ export interface CalendarEvent {
|
||||
eventColor?: string; // Optional color to represent the event
|
||||
participants?: string[]; // Optional list of participants or attendees
|
||||
private?: boolean;
|
||||
notes?: string
|
||||
}
|
@ -77,6 +77,7 @@ export const useGetEvents = () => {
|
||||
end: new Date(event.endDate.seconds * 1000),
|
||||
hideHours: event.allDay,
|
||||
eventColor: eventColor,
|
||||
notes: event.notes
|
||||
};
|
||||
})
|
||||
);
|
||||
|
Reference in New Issue
Block a user