diff --git a/app/(auth)/calendar/index.tsx b/app/(auth)/calendar/index.tsx index a552a63..8f08263 100644 --- a/app/(auth)/calendar/index.tsx +++ b/app/(auth)/calendar/index.tsx @@ -1,125 +1,159 @@ -import React, {useRef, useState} from "react"; -import {LayoutChangeEvent} from "react-native"; -import {Calendar} from "react-native-big-calendar"; -import {Button, Picker, PickerModes, SegmentedControl, Text, View} from "react-native-ui-lib"; -import {MaterialIcons} from "@expo/vector-icons"; -import {AddEventDialog} from "@/components/pages/calendar/AddEventDialog"; -import {useGetEvents} from "@/hooks/firebase/useGetEvents"; +import React, { useRef, useState } from "react"; +import { LayoutChangeEvent, StyleSheet } from "react-native"; +import { Calendar } from "react-native-big-calendar"; +import { + Button, + Picker, + PickerModes, + SegmentedControl, + Text, + View, +} from "react-native-ui-lib"; +import { MaterialIcons } from "@expo/vector-icons"; +import { AddEventDialog } from "@/components/pages/calendar/AddEventDialog"; +import { useGetEvents } from "@/hooks/firebase/useGetEvents"; import { useAuthContext } from "@/contexts/AuthContext"; +import HeaderTemplate from "@/components/shared/HeaderTemplate"; +import CalendarViewSwitch from "@/components/pages/calendar/CalendarViewSwitch"; const modeMap = new Map([ - [0, "day"], - [1, "week"], - [2, "month"] + [0, "day"], + [1, "week"], + [2, "month"], ]); const months = [ - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December" + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", ]; export default function Screen() { - const { profileData } = useAuthContext(); - const [calendarHeight, setCalendarHeight] = useState(0); - const [mode, setMode] = useState<"week" | "month" | "day">("week"); - const [selectedDate, setSelectedDate] = useState(new Date()); + const { profileData } = useAuthContext(); + const [calendarHeight, setCalendarHeight] = useState(0); + const [mode, setMode] = useState<"week" | "month" | "day">("week"); + const [selectedDate, setSelectedDate] = useState(new Date()); - const calendarContainerRef = useRef(null); - const { data: events} = useGetEvents() + const calendarContainerRef = useRef(null); + const { data: events } = useGetEvents(); - const onLayout = (event: LayoutChangeEvent) => { - const {height} = event.nativeEvent.layout; - setCalendarHeight(height); - }; + const onLayout = (event: LayoutChangeEvent) => { + const { height } = event.nativeEvent.layout; + setCalendarHeight(height); + }; - const handleSegmentChange = (index: number) => { - const selectedMode = modeMap.get(index); - if (selectedMode) { - setMode(selectedMode as "week" | "month" | "day"); - } - }; + const handleSegmentChange = (index: number) => { + const selectedMode = modeMap.get(index); + if (selectedMode) { + setMode(selectedMode as "week" | "month" | "day"); + } + }; - const handleMonthChange = (month: string) => { - const currentYear = selectedDate.getFullYear(); - const currentDay = selectedDate.getDate(); - const newMonthIndex = months.indexOf(month); + const handleMonthChange = (month: string) => { + const currentYear = selectedDate.getFullYear(); + const currentDay = selectedDate.getDate(); + const newMonthIndex = months.indexOf(month); - // Update the date with the new month while preserving the day and year - const updatedDate = new Date(currentYear, newMonthIndex, currentDay); - setSelectedDate(updatedDate); - }; + // Update the date with the new month while preserving the day and year + const updatedDate = new Date(currentYear, newMonthIndex, currentDay); + setSelectedDate(updatedDate); + }; - console.log(events) + console.log(events); - return ( - - - Welcome {profileData?.firstName} - Let's get your week started! - + return ( + + - - - handleMonthChange(itemValue as string)} - trailingAccessory={} - > - {months.map((month) => ( - - ))} - + + + handleMonthChange(itemValue as string)} + trailingAccessory={} + > + {months.map((month) => ( + + ))} + - - value === mode)?.[0] || 1} - /> - - - - {calendarHeight > 0 && ( - { - console.log(newDate) - setSelectedDate(newDate); - }} - /> - )} - - - + + value === mode + )?.[0] || 1 + } + /> + - ); + + {calendarHeight > 0 && ( + { + console.log(newDate); + setSelectedDate(newDate); + }} + /> + )} + + + + + ); } + +const styles = StyleSheet.create({ + segmentslblStyle: { + fontSize: 14, + }, + calHeader: { + borderWidth: 0 + }, +}); diff --git a/components/pages/brain_dump/BrainDumpPage.tsx b/components/pages/brain_dump/BrainDumpPage.tsx index f95249b..d9cf179 100644 --- a/components/pages/brain_dump/BrainDumpPage.tsx +++ b/components/pages/brain_dump/BrainDumpPage.tsx @@ -13,27 +13,35 @@ const BrainDumpPage = () => { return ( - - + - - { - setSearchText(value); - }} - leadingAccessory={ - - } - placeholder="Search notes..." - /> + + + + { + setSearchText(value); + }} + leadingAccessory={ + + } + placeholder="Search notes..." + /> + + - diff --git a/components/pages/brain_dump/DumpItem.tsx b/components/pages/brain_dump/DumpItem.tsx index 950c868..28048f2 100644 --- a/components/pages/brain_dump/DumpItem.tsx +++ b/components/pages/brain_dump/DumpItem.tsx @@ -1,7 +1,7 @@ import { View, Text } from "react-native-ui-lib"; import React, { useState } from "react"; import { IBrainDump } from "@/contexts/DumpContext"; -import { TouchableOpacity } from "react-native-gesture-handler"; +import { TouchableOpacity, TouchableWithoutFeedback } from "react-native-gesture-handler"; import MoveBrainDump from "./MoveBrainDump"; const BrainDumpItem = (props: { item: IBrainDump }) => { @@ -9,7 +9,7 @@ const BrainDumpItem = (props: { item: IBrainDump }) => { return ( - setIsVisible(true)}> + setIsVisible(true)}> { {props.item.title} - {props.item.description} + {props.item.description} - + ); diff --git a/components/pages/calendar/AddEventDialog.tsx b/components/pages/calendar/AddEventDialog.tsx index 8f0b334..4fb1849 100644 --- a/components/pages/calendar/AddEventDialog.tsx +++ b/components/pages/calendar/AddEventDialog.tsx @@ -22,16 +22,19 @@ export const AddEventDialog = () => { position: "absolute", bottom: 20, right: 20, - height: 60, - width: 60, + height: 40, borderRadius: 30, - backgroundColor: "#fff", + backgroundColor: "#fd1775", alignItems: 'center', justifyContent: 'center', }} + centerV + color="white" enableShadow - iconSource={() => } + iconSource={() => } onPress={() => setShow(true)} + label="New" + text60R /> { + const [show, setShow] = useState(false); + const [calView, setCalView] = useState(false); + + return ( + + setCalView(true)}> + + + Family View + + + + + setCalView(false)}> + + + My View + + + + + ); +}; + +export default CalendarViewSwitch; + +const styles = StyleSheet.create({ + switchBtnActive: { + backgroundColor: "#a1a1a1", + borderRadius: 50, + }, + switchBtn: { + backgroundColor: "white", + borderRadius: 50, + }, +}); diff --git a/components/pages/grocery/GroceryItem.tsx b/components/pages/grocery/GroceryItem.tsx index 05e30c2..750040a 100644 --- a/components/pages/grocery/GroceryItem.tsx +++ b/components/pages/grocery/GroceryItem.tsx @@ -4,6 +4,7 @@ import { Button, TouchableOpacity, Checkbox, + ButtonSize, } from "react-native-ui-lib"; import React, { useEffect, useState } from "react"; import { ProfileType, useAuthContext } from "@/contexts/AuthContext"; @@ -15,9 +16,8 @@ import { useGroceryContext, } from "@/contexts/GroceryContext"; import EditGroceryFrequency from "./EditGroceryFrequency"; -import { TextInput } from "react-native"; import EditGroceryItem from "./EditGroceryItem"; -import { TouchableWithoutFeedback } from "react-native-gesture-handler"; +import { StyleSheet } from "react-native"; const GroceryItem = ({ item, @@ -32,7 +32,9 @@ const GroceryItem = ({ const [openFreqEdit, setOpenFreqEdit] = useState(false); const [isEditingTitle, setIsEditingTitle] = useState(false); const [newTitle, setNewTitle] = useState(""); - const [category, setCategory] = useState(GroceryCategory.None); + const [category, setCategory] = useState( + GroceryCategory.None + ); const handleTitleChange = (newTitle: string) => { updateGroceryItem(item.id, { title: newTitle }); @@ -47,93 +49,124 @@ const GroceryItem = ({ }, []); return ( - { - setOpenFreqEdit(true); - }} > - { - setOpenFreqEdit(false); + { + setOpenFreqEdit(true); }} - /> - - {!isEditingTitle ? ( - - setIsEditingTitle(true)}> - {item.title} - - - ) : ( + > + { + setOpenFreqEdit(false); + }} + /> + + {!isEditingTitle ? ( + + setIsEditingTitle(true)}> + {item.title} + + + ) : ( - )} - - - {!item.approved ? ( - - ); }; - export default DrawerButton; + +const styles = StyleSheet.create({ + iconContainer: { + width: '70%', + aspectRatio: 1, + borderRadius: 50, + }, +}); diff --git a/components/shared/HeaderTemplate.tsx b/components/shared/HeaderTemplate.tsx index a2e0648..ed7d807 100644 --- a/components/shared/HeaderTemplate.tsx +++ b/components/shared/HeaderTemplate.tsx @@ -10,7 +10,7 @@ const HeaderTemplate = (props: { }) => { const { user, profileData } = useAuthContext(); return ( - + = ({ id: 0, title: "Favorite Weekend Activities", description: - "What's something fun we can do together this weekend? Maybe a new game, a picnic, or trying out a family recipe. Everyone share one idea!", + "What's something fun we can do together this weekend? Maybe a new game, a picnic?", }, { id: 1, title: "What’s For Dinner", description: - "What’s one meal you’d love to have for dinner this week? Let’s get creative with new ideas we haven’t tried yet.", + "What’s one meal you’d love to have for dinner this week?", }, { id: 2, title: "The Best Thing About Today", description: - "What was the highlight of your day? Let’s each take a moment to share something good that happened, no matter how small.", + "What was the highlight of your day? Let’s each take a moment to share something!", }, { id: 3,