diff --git a/app/(auth)/_layout.tsx b/app/(auth)/_layout.tsx index 2b7927b..31de7c7 100644 --- a/app/(auth)/_layout.tsx +++ b/app/(auth)/_layout.tsx @@ -7,7 +7,7 @@ import { DrawerItemList, } from "@react-navigation/drawer"; import { Button, View, Text, ButtonSize } from "react-native-ui-lib"; -import { StyleSheet } from "react-native"; +import { ImageBackground, StyleSheet } from "react-native"; import Feather from "@expo/vector-icons/Feather"; import DrawerButton from "@/components/shared/DrawerButton"; import { @@ -43,7 +43,16 @@ export default function TabLayout() { drawerContent={(props) => { return ( - + + Welcome to Cally { - const [selectedDate, setSelectedDate] = useAtom(selectedDateAtom); - const [mode, setMode] = useAtom(modeAtom); + const [selectedDate, setSelectedDate] = useAtom(selectedDateAtom); + const [mode, setMode] = useAtom(modeAtom); + const { profileData } = useAuthContext(); - const handleSegmentChange = (index: number) => { - const selectedMode = modeMap.get(index); - if (selectedMode) { - setTimeout(() => { - setMode(selectedMode as "day" | "week" | "month"); - }, 150); - } - }; + const handleSegmentChange = (index: number) => { + const selectedMode = modeMap.get(index); + if (selectedMode) { + setTimeout(() => { + setMode(selectedMode as "day" | "week" | "month"); + }, 150); + } + }; - const handleMonthChange = (month: string) => { - const currentDay = selectedDate.getDate(); - const currentYear = selectedDate.getFullYear(); - const newMonthIndex = months.indexOf(month); + const handleMonthChange = (month: string) => { + const currentDay = selectedDate.getDate(); + const currentYear = selectedDate.getFullYear(); + const newMonthIndex = months.indexOf(month); - const updatedDate = new Date(currentYear, newMonthIndex, currentDay); - setSelectedDate(updatedDate); - }; + const updatedDate = new Date(currentYear, newMonthIndex, currentDay); + setSelectedDate(updatedDate); + }; - const isSelectedDateToday = isSameDay(selectedDate, new Date()) + const isSelectedDateToday = isSameDay(selectedDate, new Date()); - return ( - + + + {selectedDate.getFullYear()} + + handleMonthChange(itemValue as string)} + trailingAccessory={} + topBarProps={{ + title: selectedDate.getFullYear().toString(), + titleStyle: { fontFamily: "Manrope_500Medium", fontSize: 17 }, + }} > - - - {selectedDate.getFullYear()} - - handleMonthChange(itemValue as string)} - trailingAccessory={} - topBarProps={{ - title: selectedDate.getFullYear().toString(), - titleStyle: {fontFamily: "Manrope_500Medium", fontSize: 17}, - }} - > - {months.map((month) => ( - - ))} - - + {months.map((month) => ( + + ))} + + - - {!isSelectedDateToday && ( -