import { View, Text, Button, Switch } from "react-native-ui-lib"; import React, { useState } from "react"; import PointsSlider from "@/components/shared/PointsSlider"; import { repeatOptions, useToDosContext } from "@/contexts/ToDosContext"; import { Feather, AntDesign, Ionicons } from "@expo/vector-icons"; import { Dialog, TextField, DateTimePicker, Picker, ButtonSize, } from "react-native-ui-lib"; import { PanningDirectionsEnum } from "react-native-ui-lib/src/incubator/panView"; import { Dimensions, StyleSheet } from "react-native"; import DropModalIcon from "@/assets/svgs/DropModalIcon"; import { IToDo } from "@/hooks/firebase/types/todoData"; interface IAddChoreDialog { isVisible: boolean; setIsVisible: (value: boolean) => void; selectedTodo?: IToDo; } const defaultTodo = { id: "", title: "", points: 10, date: new Date(), rotate: false, repeatType: "Every week", }; const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => { const { addToDo, updateToDo } = useToDosContext(); const [todo, setTodo] = useState( addChoreDialogProps.selectedTodo ?? defaultTodo ); const { width, height } = Dimensions.get("screen"); const [points, setPoints] = useState(todo.points); const handleClose = () => { setTodo(defaultTodo); addChoreDialogProps.setIsVisible(false); }; const handleChange = (text: string) => { const numericValue = parseInt(text, 10); if (!isNaN(numericValue) && numericValue >= 0 && numericValue <= 100) { setPoints(numericValue); } else if (text === "") { setPoints(0); } }; return ( handleClose} containerStyle={{ borderRadius: 10, backgroundColor: "white", alignSelf: "stretch", padding: 0, paddingTop: 4, margin: 0, }} visible={addChoreDialogProps.isVisible} > ); }; export default AddChoreDialog; const styles = StyleSheet.create({ divider: { height: 1, backgroundColor: "#e4e4e4", marginVertical: 15 }, gradient: { height: "25%", position: "absolute", bottom: 0, width: "100%", }, buttonContainer: { position: "absolute", bottom: 25, width: "100%", }, button: { backgroundColor: "rgb(253, 23, 117)", paddingVertical: 20, }, topBtn: { backgroundColor: "white", color: "#05a8b6", }, rotateSwitch: { marginLeft: 35, marginBottom: 10, marginTop: 25, }, });