- Reverted the Add todo press functionality to open the Add todo dialog instead of redirecting to Todos page

This commit is contained in:
Dejan
2024-11-20 19:27:14 +01:00
parent 81477ed85b
commit cc2a649f8c

View File

@ -1,5 +1,4 @@
import React, {useState} from "react"; import React, {useState} from "react";
import {MaterialIcons,} from "@expo/vector-icons";
import {Button, Card, Dialog, PanningProvider, Text, View,} from "react-native-ui-lib"; import {Button, Card, Dialog, PanningProvider, Text, View,} from "react-native-ui-lib";
import {StyleSheet, TouchableOpacity} from "react-native"; import {StyleSheet, TouchableOpacity} from "react-native";
import AddChoreDialog from "../todos/AddChoreDialog"; import AddChoreDialog from "../todos/AddChoreDialog";
@ -11,7 +10,6 @@ import NavToDosIcon from "@/assets/svgs/NavToDosIcon";
import {useSetAtom} from "jotai"; import {useSetAtom} from "jotai";
import {selectedNewEventDateAtom} from "@/components/pages/calendar/atoms"; import {selectedNewEventDateAtom} from "@/components/pages/calendar/atoms";
import PlusIcon from "@/assets/svgs/PlusIcon"; import PlusIcon from "@/assets/svgs/PlusIcon";
import {useNavigation} from "expo-router";
export const AddEventDialog = () => { export const AddEventDialog = () => {
const [show, setShow] = useState(false); const [show, setShow] = useState(false);
@ -33,7 +31,6 @@ export const AddEventDialog = () => {
}, 100); }, 100);
}; };
const navigation = useNavigation()
return ( return (
<ToDosContextProvider> <ToDosContextProvider>
<> <>
@ -118,7 +115,7 @@ export const AddEventDialog = () => {
}} }}
label="Add To Do" label="Add To Do"
labelStyle={styles.btnLabel} labelStyle={styles.btnLabel}
onPress={() => navigation.navigate("todos")} onPress={() => setChoreDialogVisible(true)}
iconSource={() => ( iconSource={() => (
<NavToDosIcon <NavToDosIcon
color="white" color="white"