diff --git a/components/pages/brain_dump/BrainDumpPage.tsx b/components/pages/brain_dump/BrainDumpPage.tsx index ce2803d..979e9c9 100644 --- a/components/pages/brain_dump/BrainDumpPage.tsx +++ b/components/pages/brain_dump/BrainDumpPage.tsx @@ -1,123 +1,119 @@ -import { Dimensions, ScrollView } from "react-native"; -import React, { useState } from "react"; -import { View, Text, Button } from "react-native-ui-lib"; +import {Dimensions, ScrollView, StyleSheet} from "react-native"; +import React, {useState} from "react"; +import {Button, Text, TextField, View} from "react-native-ui-lib"; import DumpList from "./DumpList"; import HeaderTemplate from "@/components/shared/HeaderTemplate"; -import { TextField } from "react-native-ui-lib"; -import { StyleSheet } from "react-native"; -import { Feather, MaterialIcons } from "@expo/vector-icons"; -import { TextInput } from "react-native-gesture-handler"; +import {Feather, MaterialIcons} from "@expo/vector-icons"; import AddBrainDump from "./AddBrainDump"; import LinearGradient from "react-native-linear-gradient"; const BrainDumpPage = () => { - const [searchText, setSearchText] = useState(""); - const [isAddVisible, setIsAddVisible] = useState(false); + const [searchText, setSearchText] = useState(""); + const [isAddVisible, setIsAddVisible] = useState(false); - return ( - - - - - - Drop your notes on-the-go here, and{"\n"}organize them later. - - } - /> + return ( + - - { - setSearchText(value); - }} - leadingAccessory={ - - } - style={{ - fontFamily: "Manrope_500Medium", - fontSize: 15, - }} - placeholder="Search notes..." - /> - - + + + + Drop your notes on-the-go here, and{"\n"}organize them later. + + } + /> + + + { + setSearchText(value); + }} + leadingAccessory={ + + } + style={{ + fontFamily: "Manrope_500Medium", + fontSize: 15, + }} + placeholder="Search notes..." + /> + + + + + - - - - - - - - - ); + + + + + ); }; const styles = StyleSheet.create({ - searchField: { - borderWidth: 0.7, - borderColor: "#9b9b9b", - borderRadius: 15, - height: 42, - paddingLeft: 10, - marginVertical: 20, - }, + searchField: { + borderWidth: 0.7, + borderColor: "#9b9b9b", + borderRadius: 15, + height: 42, + paddingLeft: 10, + marginVertical: 20, + }, }); export default BrainDumpPage; diff --git a/components/pages/calendar/CalendarHeader.tsx b/components/pages/calendar/CalendarHeader.tsx index fbf2c7d..e8830da 100644 --- a/components/pages/calendar/CalendarHeader.tsx +++ b/components/pages/calendar/CalendarHeader.tsx @@ -1,134 +1,125 @@ -import React, { memo } from "react"; -import { - Button, - Picker, - PickerModes, - SegmentedControl, - Text, - View, -} from "react-native-ui-lib"; -import { MaterialIcons } from "@expo/vector-icons"; -import { modeMap, months } from "./constants"; -import { StyleSheet } from "react-native"; -import { useAtom } from "jotai"; -import { modeAtom, selectedDateAtom } from "@/components/pages/calendar/atoms"; -import { isSameDay } from "date-fns"; -import { useAuthContext } from "@/contexts/AuthContext"; +import React, {memo} from "react"; +import {Button, Picker, PickerModes, SegmentedControl, Text, View,} from "react-native-ui-lib"; +import {MaterialIcons} from "@expo/vector-icons"; +import {modeMap, months} from "./constants"; +import {StyleSheet} from "react-native"; +import {useAtom} from "jotai"; +import {modeAtom, selectedDateAtom} from "@/components/pages/calendar/atoms"; +import {isSameDay} from "date-fns"; +import {useAuthContext} from "@/contexts/AuthContext"; export const CalendarHeader = memo(() => { - const [selectedDate, setSelectedDate] = useAtom(selectedDateAtom); - const [mode, setMode] = useAtom(modeAtom); - const { profileData } = useAuthContext(); + 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 }, - }} - > - {months.map((month) => ( - - ))} - - - - - {!isSelectedDateToday && ( -