diff --git a/components/pages/reminders/addReminderModal.tsx b/components/pages/reminders/addReminderModal.tsx new file mode 100644 index 0000000..11bec90 --- /dev/null +++ b/components/pages/reminders/addReminderModal.tsx @@ -0,0 +1,246 @@ +import { StyleSheet } from "react-native"; +import React, { useState } from "react"; +import { + Dialog, + Text, + PanningProvider, + TextField, + Button, + View, + Checkbox, + Switch, + Picker, +} from "react-native-ui-lib"; +import ButtonOutlined from "@/components/ui/ButtonOutlined"; +import AntDesign from "@expo/vector-icons/AntDesign"; +import Feather from "@expo/vector-icons/Feather"; +import Ionicons from "@expo/vector-icons/Ionicons"; +import { DateTimePicker } from "react-native-ui-lib"; +import { TouchableOpacity } from "react-native-gesture-handler"; + +interface ReminderModalProps { + visible: boolean; + onClose: () => void; + /*onSave: (reminderText: string) => void;*/ +} + +interface reminderOptions { + label: string; + value: string; +} + +const AddReminderModal = (props: ReminderModalProps) => { + const { visible, onClose /*, onSave*/ } = props; + const [reminderTitle, setReminderTitle] = useState(""); + const [time, setTime] = useState(new Date()); + const [autoRepeat, setAutoRepeat] = useState(false); + const [reminder, setReminder] = useState({ + label: "Remind me just in time", + value: "just-in-time", + }); + + const reminderOptions = [ + { label: "Remind me just in time", value: "just-in-time" }, + { label: "Remind me 5 minutes before", value: "5-min-before" }, + { label: "Remind me 10 minutes before", value: "10-min-before" }, + { label: "Remind me 15 minutes before", value: "15-min-before" }, + { label: "Remind me 30 minutes before", value: "30-min-before" }, + { label: "Remind me 1 hour before", value: "1-hr-before" }, + { label: "Remind me 1 day before", value: "1-day-before" }, + ]; + + const handleDateTimeChange = (selectedTime: Date) => { + setTime(selectedTime); + }; + + return ( + + + New Reminder + + + + Profiles + {}} + > + + + + setReminderTitle(text)} + placeholder="Reminder Title" + text70L + /> + + + + + Reminder Time + + + + + + + + + + + + + { + setReminder({ label: item.label, value: item.value }); + }} + useDialog + fieldType="form" + placeholder="Select a reminder" + items={reminderOptions} + trailingAccessory={ + + } + > + + + + + + + Auto Repeat + setAutoRepeat(value)} + /> + + + + + + {}} + > + + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + paddingVertical: 10, + display: 'flex', + flexDirection: 'column', + justifyContent: 'space-between' + }, + inner: { + paddingHorizontal: 20, + display: "flex", + flexDirection: "column", + }, + title: { + fontSize: 20, + fontWeight: "400", + textAlign: "center", + }, + divider: { + width: "100%", + height: 1, + backgroundColor: "#E0E0E0", + marginVertical: 10, + }, + iconTitle: { + padding: 10, + borderRadius: 10, + borderWidth: 1, + borderColor: "#E0E0E0", + display: "flex", + flexDirection: "row", + }, + inputsBetween: { + paddingVertical: 12, + paddingHorizontal: 15, + marginVertical: 5, + borderRadius: 10, + borderWidth: 1, + borderColor: "#E0E0E0", + display: "flex", + alignItems: "center", + flexDirection: "row", + justifyContent: "space-between", + }, + inputsStart: { + paddingVertical: 12, + paddingHorizontal: 15, + marginVertical: 5, + borderRadius: 10, + borderWidth: 1, + borderColor: "#E0E0E0", + display: "flex", + alignItems: "center", + flexDirection: "row", + justifyContent: "flex-start", + }, +}); + +export default AddReminderModal; diff --git a/components/pages/reminders/remindersList.tsx b/components/pages/reminders/remindersList.tsx index 78c2023..f61ddac 100644 --- a/components/pages/reminders/remindersList.tsx +++ b/components/pages/reminders/remindersList.tsx @@ -1,14 +1,8 @@ import { useState } from "react"; import { StyleSheet } from "react-native"; -import { - Button, - Card, - Checkbox, - Icon, - ListItem, - Text, - View, -} from "react-native-ui-lib"; +import { Button, Card, Checkbox, Text, View } from "react-native-ui-lib"; +import AddReminderModal from "./addReminderModal"; +import ButtonOutlined from "@/components/ui/ButtonOutlined"; interface Reminder { title: string; @@ -18,6 +12,7 @@ interface Reminder { } const RemindersList = () => { + const [isModalVisible, setIsModalVisible] = useState(false); const [reminders, setReminders] = useState([ { title: "Shaving Time", @@ -32,8 +27,13 @@ const RemindersList = () => { done: false, }, ]); + return ( + setIsModalVisible(false)} + /> { }} > Reminders - + setIsModalVisible(true)} + /> {reminders.map((reminder, index) => ( - + {reminder.title} @@ -113,7 +113,7 @@ const styles = StyleSheet.create({ height: 45, width: 45, backgroundColor: "#fcf4eb", - marginRight: 10 + marginRight: 10, }, }); export default RemindersList; diff --git a/components/ui/ButtonOutlined.tsx b/components/ui/ButtonOutlined.tsx new file mode 100644 index 0000000..298b257 --- /dev/null +++ b/components/ui/ButtonOutlined.tsx @@ -0,0 +1,34 @@ +import { StyleSheet, View } from "react-native"; +import React from "react"; +import { Text, Button } from "react-native-ui-lib"; + +interface ButtonProps { + title: string; + size: keyof typeof Button.sizes; + onPress: () => void; +} + +const ButtonOutlined = (props: ButtonProps) => { + const { size, onPress, title } = props; + return ( + + ); +}; +export default ButtonOutlined; +const styles = StyleSheet.create({ + button: { + backgroundColor: "white", + color: "black", + borderColor: "lightgray", + borderWidth: 1, + borderRadius: 5, + padding: 0, + marginHorizontal: 0 + }, + buttonText: { + }, +}); diff --git a/package-lock.json b/package-lock.json index 18d0d5d..eccf16f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@expo/vector-icons": "^14.0.2", "@react-native-community/blur": "^4.4.0", + "@react-native-community/datetimepicker": "^8.2.0", "@react-native-firebase/app": "^20.3.0", "@react-native-firebase/auth": "^20.3.0", "@react-native-firebase/crashlytics": "^20.3.0", @@ -7011,6 +7012,29 @@ "node": ">=8" } }, + "node_modules/@react-native-community/datetimepicker": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@react-native-community/datetimepicker/-/datetimepicker-8.2.0.tgz", + "integrity": "sha512-qrUPhiBvKGuG9Y+vOqsc56RPFcHa1SU2qbAMT0hfGkoFIj3FodE0VuPVrEa8fgy7kcD5NQmkZIKgHOBLV0+hWg==", + "license": "MIT", + "dependencies": { + "invariant": "^2.2.4" + }, + "peerDependencies": { + "expo": ">=50.0.0", + "react": "*", + "react-native": "*", + "react-native-windows": "*" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + }, + "react-native-windows": { + "optional": true + } + } + }, "node_modules/@react-native-firebase/app": { "version": "20.3.0", "resolved": "https://registry.npmjs.org/@react-native-firebase/app/-/app-20.3.0.tgz", diff --git a/package.json b/package.json index e48a3ef..90dc306 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "dependencies": { "@expo/vector-icons": "^14.0.2", "@react-native-community/blur": "^4.4.0", + "@react-native-community/datetimepicker": "^8.2.0", "@react-native-firebase/app": "^20.3.0", "@react-native-firebase/auth": "^20.3.0", "@react-native-firebase/crashlytics": "^20.3.0",