mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +00:00
- Changed the location field style
- Added creator information on the events in the events dialog
This commit is contained in:
@ -38,6 +38,7 @@ import { useGetFamilyMembers } from "@/hooks/firebase/useGetFamilyMembers";
|
|||||||
import BinIcon from "@/assets/svgs/BinIcon";
|
import BinIcon from "@/assets/svgs/BinIcon";
|
||||||
import DeleteEventDialog from "./DeleteEventDialog";
|
import DeleteEventDialog from "./DeleteEventDialog";
|
||||||
import { useDeleteEvent } from "@/hooks/firebase/useDeleteEvent";
|
import { useDeleteEvent } from "@/hooks/firebase/useDeleteEvent";
|
||||||
|
import AddPersonIcon from "@/assets/svgs/AddPersonIcon";
|
||||||
|
|
||||||
const daysOfWeek = [
|
const daysOfWeek = [
|
||||||
{ label: "Monday", value: "monday" },
|
{ label: "Monday", value: "monday" },
|
||||||
@ -71,7 +72,6 @@ export const ManuallyAddEventModal = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const detailsRef = useRef<TextFieldRef>(null);
|
const detailsRef = useRef<TextFieldRef>(null);
|
||||||
const locationRef = useRef<TextFieldRef>(null);
|
|
||||||
|
|
||||||
const [title, setTitle] = useState<string>(editEvent?.title || "");
|
const [title, setTitle] = useState<string>(editEvent?.title || "");
|
||||||
const [details, setDetails] = useState<string>(editEvent?.notes || "");
|
const [details, setDetails] = useState<string>(editEvent?.notes || "");
|
||||||
@ -142,6 +142,15 @@ export const ManuallyAddEventModal = () => {
|
|||||||
const { data: members } = useGetFamilyMembers(true);
|
const { data: members } = useGetFamilyMembers(true);
|
||||||
const titleRef = useRef<TextFieldRef>(null);
|
const titleRef = useRef<TextFieldRef>(null);
|
||||||
|
|
||||||
|
const [creator, setCreator] = useState('');
|
||||||
|
useEffect(() => {
|
||||||
|
if (editEvent) {
|
||||||
|
let creatorMember = members?.find((member) => member?.uid === editEvent.creatorId);
|
||||||
|
const fullName = `${creatorMember?.firstName ?? ""}`;
|
||||||
|
setCreator(fullName);
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
const isLoading = isDeleting || isAdding;
|
const isLoading = isDeleting || isAdding;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -647,34 +656,38 @@ export const ManuallyAddEventModal = () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.divider} />
|
<View style={styles.divider} />
|
||||||
<View marginH-25 marginB-0 spread centerV flex-1>
|
<View marginH-28 marginB-0 centerV flex-1>
|
||||||
<TouchableOpacity onPress={() => locationRef?.current?.focus()}>
|
<View row centerV style={{ flexGrow: 1}}>
|
||||||
<View row centerV>
|
<Ionicons name="location-outline" size={25} color={"#919191"}/>
|
||||||
<Ionicons name="location-outline" size={28} color="#919191" />
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
fontFamily: "PlusJakartaSans_500Medium",
|
|
||||||
fontSize: 16,
|
|
||||||
}}
|
|
||||||
marginL-10
|
|
||||||
>
|
|
||||||
Location
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</TouchableOpacity>
|
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
|
placeholder="Location"
|
||||||
value={location}
|
value={location}
|
||||||
onChangeText={(text) => setLocation(text)}
|
onChangeText={(text) => {
|
||||||
ref={locationRef}
|
setLocation(text);
|
||||||
maxLength={2000}
|
}}
|
||||||
multiline
|
placeholderTextColor="#2d2d30"
|
||||||
numberOfLines={2}
|
style={{ fontFamily: "Manrope_500Medium", fontSize: 16, minWidth: "100%"}}
|
||||||
marginT-5
|
marginL-12
|
||||||
marginL-10
|
paddingR-12
|
||||||
style={{ flex: 1 }}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
|
{editEvent && <>
|
||||||
|
<View style={styles.divider} />
|
||||||
|
<View marginH-32 marginB-0 centerV flex-1>
|
||||||
|
<View row centerV style={{ flexGrow: 1}}>
|
||||||
|
<AddPersonIcon />
|
||||||
|
<TextField
|
||||||
|
editable={false}
|
||||||
|
value={creator}
|
||||||
|
placeholderTextColor="#2d2d30"
|
||||||
|
style={{ fontFamily: "Manrope_500Medium", fontSize: 16, minWidth: "100%", color: "black"}}
|
||||||
|
marginL-12
|
||||||
|
paddingR-12
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</>}
|
||||||
<View style={styles.divider} />
|
<View style={styles.divider} />
|
||||||
<View marginH-30 marginB-0 spread centerV flex-1>
|
<View marginH-30 marginB-0 spread centerV flex-1>
|
||||||
<TouchableOpacity onPress={() => detailsRef?.current?.focus()}>
|
<TouchableOpacity onPress={() => detailsRef?.current?.focus()}>
|
||||||
|
|||||||
Reference in New Issue
Block a user