From 0f125cd63f73070cb42c8cf8c55715e804772c68 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sat, 23 Aug 2025 17:15:18 -0400 Subject: [PATCH] Enhance modal components with consistent button sizes and improve calendar styles for better responsiveness and layout --- index.html | 2 +- src/components/animations/PageTransition.jsx | 2 +- src/contexts/RouterContext.jsx | 10 +- src/utils/TokenManager.jsx | 4 +- src/views/ChoreEdit/ChoreView.jsx | 6 +- src/views/Modals/EditHistoryModal.jsx | 4 +- .../Modals/Inputs/BackupRestoreModal.jsx | 6 +- src/views/Modals/Inputs/ConfirmationModal.jsx | 2 + src/views/Modals/Inputs/CreateThingModal.jsx | 5 +- src/views/Modals/Inputs/DateModal.jsx | 6 +- src/views/Modals/Inputs/EditThingState.jsx | 4 +- src/views/Modals/Inputs/LabelModal.jsx | 4 +- .../Modals/Inputs/PasswordChangeModal.jsx | 2 + src/views/Modals/Inputs/SelectModal.jsx | 4 +- src/views/Modals/Inputs/TextModal.jsx | 4 +- src/views/Modals/Inputs/UserModal.jsx | 2 +- src/views/Modals/Inputs/WriteNFCModal.jsx | 3 +- src/views/Modals/RedeemPointsModal.jsx | 2 + src/views/components/AddTaskModal.jsx | 9 +- src/views/components/Calendar.css | 29 +- src/views/components/CalendarDual.css | 266 ++++++++++++++++++ 21 files changed, 346 insertions(+), 30 deletions(-) create mode 100644 src/views/components/CalendarDual.css diff --git a/index.html b/index.html index 1ac23fa..db50e56 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + diff --git a/src/components/animations/PageTransition.jsx b/src/components/animations/PageTransition.jsx index 5fb011a..cf7c580 100644 --- a/src/components/animations/PageTransition.jsx +++ b/src/components/animations/PageTransition.jsx @@ -57,7 +57,7 @@ const PageTransition = ({ children }) => { const previousLevel = getRouteLevel(prevLocation.current.pathname) // Determine if we're navigating back (to a higher level in hierarchy) - isNavigatingBack.current = currentLevel < previousLevel + // isNavigatingBack.current = currentLevel < previousLevel window.scrollTo({ top: 0, left: 0, behavior: 'instant' }) prevLocation.current = location diff --git a/src/contexts/RouterContext.jsx b/src/contexts/RouterContext.jsx index 654750f..da38c15 100644 --- a/src/contexts/RouterContext.jsx +++ b/src/contexts/RouterContext.jsx @@ -1,6 +1,5 @@ import App from '@/App' import ChoreEdit from '@/views/ChoreEdit/ChoreEdit' -import ChoresOverview from '@/views/ChoresOverview' import Error from '@/views/Error' import Settings from '@/views/Settings/Settings' import { Capacitor } from '@capacitor/core' @@ -12,6 +11,7 @@ import LoginView from '../views/Authorization/LoginView' import SignupView from '../views/Authorization/Signup' import UpdatePasswordView from '../views/Authorization/UpdatePasswordView' import ChoreView from '../views/ChoreEdit/ChoreView' +import ArchivedTasks from '../views/Chores/ArchivedTasks' import MyChores from '../views/Chores/MyChores' import JoinCircleView from '../views/Circles/JoinCircle' import ChoreHistory from '../views/History/ChoreHistory' @@ -53,7 +53,11 @@ const Router = createBrowserRouter([ }, { path: '/chores', - element: , + element: , + }, + { + path: '/archived', + element: , }, { path: '/chores/:choreId/edit', @@ -99,6 +103,7 @@ const Router = createBrowserRouter([ path: '/signup', element: , }, + { path: '/auth/:provider', element: , @@ -151,6 +156,7 @@ const Router = createBrowserRouter([ path: 'labels/', element: , }, + { path: '*', element: , diff --git a/src/utils/TokenManager.jsx b/src/utils/TokenManager.jsx index 2109364..665a265 100644 --- a/src/utils/TokenManager.jsx +++ b/src/utils/TokenManager.jsx @@ -93,7 +93,9 @@ export async function Fetch(url, options) { if (response.ok) { const data = await response.clone().json() - const optionsHash = murmurhash.v3(JSON.stringify(options)) + const optionWithoutToken = { ...options } + delete optionWithoutToken.headers.Authorization + const optionsHash = murmurhash.v3(JSON.stringify(optionWithoutToken)) await localStore.saveToCache(fullURL + optionsHash, data) networkManager.setOnline() } else if (response.status === 401) { diff --git a/src/views/ChoreEdit/ChoreView.jsx b/src/views/ChoreEdit/ChoreView.jsx index 07f5bd8..a58f043 100644 --- a/src/views/ChoreEdit/ChoreView.jsx +++ b/src/views/ChoreEdit/ChoreView.jsx @@ -137,7 +137,8 @@ const ChoreView = () => { }`, subtext: ` Last: ${ chore.lastCompletedDate - ? performers.find(p => p.id === chore.lastCompletedBy)?.displayName + ? performers.find(p => p.userId === chore.lastCompletedBy) + ?.displayName : '--' }`, }, @@ -165,7 +166,8 @@ const ChoreView = () => { icon: , title: 'Details', subtext: `Created By: ${ - performers.find(p => p.id === chore.createdBy)?.displayName || 'N/A' + performers.find(p => p.userId === chore.createdBy)?.displayName || + 'N/A' }`, }, ] diff --git a/src/views/Modals/EditHistoryModal.jsx b/src/views/Modals/EditHistoryModal.jsx index c53d160..4995753 100644 --- a/src/views/Modals/EditHistoryModal.jsx +++ b/src/views/Modals/EditHistoryModal.jsx @@ -68,6 +68,7 @@ function EditHistoryModal({ config, historyRecord }) { {/* 3 button save , cancel and delete */} - - diff --git a/src/views/Modals/Inputs/DateModal.jsx b/src/views/Modals/Inputs/DateModal.jsx index 45db330..2bc5466 100644 --- a/src/views/Modals/Inputs/DateModal.jsx +++ b/src/views/Modals/Inputs/DateModal.jsx @@ -23,11 +23,11 @@ function DateModal({ isOpen, onClose, onSave, current, title }) { value={date} onChange={e => setDate(e.target.value)} /> - - - diff --git a/src/views/Modals/Inputs/EditThingState.jsx b/src/views/Modals/Inputs/EditThingState.jsx index fb90e55..2ddd98a 100644 --- a/src/views/Modals/Inputs/EditThingState.jsx +++ b/src/views/Modals/Inputs/EditThingState.jsx @@ -55,10 +55,10 @@ function EditThingStateModal({ isOpen, onClose, onSave, currentThing }) { - - diff --git a/src/views/Modals/Inputs/LabelModal.jsx b/src/views/Modals/Inputs/LabelModal.jsx index f6f675e..0cc4038 100644 --- a/src/views/Modals/Inputs/LabelModal.jsx +++ b/src/views/Modals/Inputs/LabelModal.jsx @@ -154,10 +154,10 @@ function LabelModal({ isOpen, onClose, label }) { )} - - diff --git a/src/views/Modals/Inputs/PasswordChangeModal.jsx b/src/views/Modals/Inputs/PasswordChangeModal.jsx index 106c073..ae323ab 100644 --- a/src/views/Modals/Inputs/PasswordChangeModal.jsx +++ b/src/views/Modals/Inputs/PasswordChangeModal.jsx @@ -92,6 +92,7 @@ function PassowrdChangeModal({ isOpen, onClose }) { - diff --git a/src/views/Modals/Inputs/TextModal.jsx b/src/views/Modals/Inputs/TextModal.jsx index d682ad3..a86d432 100644 --- a/src/views/Modals/Inputs/TextModal.jsx +++ b/src/views/Modals/Inputs/TextModal.jsx @@ -33,10 +33,10 @@ function TextModal({ /> - - diff --git a/src/views/Modals/Inputs/UserModal.jsx b/src/views/Modals/Inputs/UserModal.jsx index 6009267..b0b52ee 100644 --- a/src/views/Modals/Inputs/UserModal.jsx +++ b/src/views/Modals/Inputs/UserModal.jsx @@ -36,7 +36,7 @@ const UserModal = ({ isOpen, performers = [], onSelect, onClose }) => { ))} - diff --git a/src/views/Modals/Inputs/WriteNFCModal.jsx b/src/views/Modals/Inputs/WriteNFCModal.jsx index 691b5d3..bde9aba 100644 --- a/src/views/Modals/Inputs/WriteNFCModal.jsx +++ b/src/views/Modals/Inputs/WriteNFCModal.jsx @@ -95,6 +95,7 @@ function WriteNFCModal({ config }) { - diff --git a/src/views/Modals/RedeemPointsModal.jsx b/src/views/Modals/RedeemPointsModal.jsx index 7441f7d..bde47e4 100644 --- a/src/views/Modals/RedeemPointsModal.jsx +++ b/src/views/Modals/RedeemPointsModal.jsx @@ -215,6 +215,7 @@ function RedeemPointsModal({ config }) { {/* Action Buttons */} -