From 505709b0357cc8018da7e6a8c4c7d514928b65a8 Mon Sep 17 00:00:00 2001 From: David Araujo Date: Tue, 4 Feb 2025 15:52:24 -0500 Subject: [PATCH 1/4] adding current changes --- app.json | 21 ++++- app/(home)/index.tsx | 12 +-- app/(user)/_layout.tsx | 8 +- app/index.tsx | 4 +- assets/images/home-screen/Calendar.png | Bin 0 -> 678 bytes .../text-entry-screen/TextEntryScreen.tsx | 89 ++++++++++++++---- lib/watermelon/post.ts | 3 + lib/watermelon/schema.ts | 1 + lib/watermelon/sync.ts | 1 + package-lock.json | 72 +++++++++++++- package.json | 24 ++--- 11 files changed, 183 insertions(+), 52 deletions(-) create mode 100644 assets/images/home-screen/Calendar.png diff --git a/app.json b/app.json index e9b4a97..fb79e29 100644 --- a/app.json +++ b/app.json @@ -24,11 +24,15 @@ } ] }, - "associatedDomains": ["applinks:firmcollective.org"], + "associatedDomains": [ + "applinks:firmcollective.org" + ], "bundleIdentifier": "com.firmcollective.OneVoiceEcho" }, "android": { - "permissions": ["android.permission.INTERNET"], + "permissions": [ + "android.permission.INTERNET" + ], "adaptiveIcon": { "foregroundImage": "./assets/images/adaptive-icon.png", "backgroundColor": "#ffffff" @@ -44,7 +48,10 @@ "pathPrefix": "/login" } ], - "category": ["BROWSABLE", "DEFAULT"] + "category": [ + "BROWSABLE", + "DEFAULT" + ] } ], "package": "com.firmcollective.OneVoiceEcho" @@ -62,7 +69,10 @@ "extraPods": [ { "name": "simdjson", - "configurations": ["Debug", "Release"], + "configurations": [ + "Debug", + "Release" + ], "path": "../node_modules/@nozbe/simdjson", "modular_headers": true } @@ -72,7 +82,8 @@ ], "expo-router", "expo-secure-store", - "expo-build-properties" + "expo-build-properties", + "expo-font" ], "experiments": { "typedRoutes": true diff --git a/app/(home)/index.tsx b/app/(home)/index.tsx index 2c4f755..b0d2700 100644 --- a/app/(home)/index.tsx +++ b/app/(home)/index.tsx @@ -1,14 +1,10 @@ import React from 'react'; -import { View, Text } from 'react-native'; - +import {View, Text} from 'react-native'; export default function Home() { return ( - Welcome to the Home Screen - - ) + Welcome to the Home Screen + + ); } - - - diff --git a/app/(user)/_layout.tsx b/app/(user)/_layout.tsx index d3745e5..89b3efd 100644 --- a/app/(user)/_layout.tsx +++ b/app/(user)/_layout.tsx @@ -15,10 +15,10 @@ export default function TabLayout() { - - - - + + + + ); diff --git a/app/index.tsx b/app/index.tsx index 19d9e09..d295e71 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -18,6 +18,6 @@ export default function IndexPage() { return ; } - // return ; - return ; + return ; + // return ; } diff --git a/assets/images/home-screen/Calendar.png b/assets/images/home-screen/Calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..d035f3e4ac76440991549e5bfed90e44c274a8fe GIT binary patch literal 678 zcmV;X0$KfuP)BgwtZ*4CVePtb zgIt)Q%2gkXS$2U>P`t~=JQH3a^Slh|v2bR7lE?Ym!WHQJ2b{gb$WzhzO$SYEX8V|i z6#x-(VVk!o&{k#*^$UeYNi5tj7Xk%fKHAlO7H)vQlu^G66xeU8s9*lAU~2(1-^ShP z;|%;p;&GZ9E;{PI@C8yAe`4*5@FJ;uc|Dg|EM~?g-05Q#^b65^EjEp@yM55_$;Q|j zka)N0ec&?n3QrnuB#Da--e}wtT~6|-c+Mi%YXb7k~T3olvwPB=dfLmRZT zD8cSPiu!IM;E=>SxqCEW+)d)QtsFn8>&iBB?8u|R8?{kP=xl4s4pCLX2>sSu{0I=5QKsX&fQvd(} M07*qoM6N<$g0ibIvH$=8 literal 0 HcmV?d00001 diff --git a/components/user/text-entry-screen/TextEntryScreen.tsx b/components/user/text-entry-screen/TextEntryScreen.tsx index ef3cf65..bbf5ffc 100644 --- a/components/user/text-entry-screen/TextEntryScreen.tsx +++ b/components/user/text-entry-screen/TextEntryScreen.tsx @@ -1,15 +1,19 @@ import React, {useState} from 'react'; -import {View, StyleSheet} from 'react-native'; +import {View, StyleSheet, Image, TouchableOpacity} from 'react-native'; import {Text, TextInput, TextInputSemiBold} from '@/components/StyledText'; -import {TouchableOpacity} from 'react-native'; import {Post} from '@/lib/watermelon/post'; import {database} from '@/lib/watermelon/database'; import {useAuth} from '@/providers/AuthProvider'; import {useRouter} from 'expo-router'; +import {SafeAreaView} from 'react-native-safe-area-context'; +import {Icon} from '@rneui/themed'; +import {Calendar} from 'react-native-calendars'; const TextEntryScreen = () => { const [title, setTitle] = useState(''); const [text, setText] = useState(''); + const [selectedDate, setSelectedDate] = useState(new Date()); + const [showCalendar, setShowCalendar] = useState(false); const {session} = useAuth(); const router = useRouter(); @@ -19,13 +23,11 @@ const TextEntryScreen = () => { title, text, user: session?.user.id || 'unknown_user', + date: selectedDate.toISOString(), }); - // reset input values setTitle(''); setText(''); - - // re-route to home page after successful post creation router.push('/'); } catch (error) { console.error('Error creating post:', error); @@ -33,12 +35,55 @@ const TextEntryScreen = () => { }; return ( - + + {/* Back Button */} + router.navigate('/')}> + + + + {/* Date Picker Button */} + setShowCalendar(!showCalendar)} + > + + + {selectedDate.toLocaleDateString('en-US', { + weekday: 'long', + month: 'long', + day: 'numeric', + })} + + + + {/* Save Button */} Save + + {/* Calendar Popup */} + {showCalendar && ( + + { + setSelectedDate(new Date(day.dateString)); + setShowCalendar(false); // Hide after selection + }} + markedDates={{ + [selectedDate.toISOString().split('T')[0]]: { + selected: true, + selectedColor: 'purple', + }, + }} + /> + + )} + + {/* Text Input Fields */} { multiline /> - - {/* Button to see all posts within local storage -