From d9d93ffad350321ab04ad9a5e3cf861b2979d8a7 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Tue, 10 Feb 2026 20:38:01 -0500 Subject: [PATCH] clean up imports and remove unused quick schedule functionality in DateModal --- src/views/Labels/LabelView.jsx | 26 +++++------ src/views/Modals/Inputs/DateModal.jsx | 63 ++------------------------- 2 files changed, 16 insertions(+), 73 deletions(-) diff --git a/src/views/Labels/LabelView.jsx b/src/views/Labels/LabelView.jsx index 875414a..1a6ddcb 100644 --- a/src/views/Labels/LabelView.jsx +++ b/src/views/Labels/LabelView.jsx @@ -1,14 +1,14 @@ import DeleteIcon from '@mui/icons-material/Delete' import EditIcon from '@mui/icons-material/Edit' import { - Avatar, - Box, - Chip, - CircularProgress, - Container, - IconButton, - Stack, - Typography, + Avatar, + Box, + Chip, + CircularProgress, + Container, + IconButton, + Stack, + Typography, } from '@mui/joy' import { useEffect, useState } from 'react' import LabelModal from '../Modals/Inputs/LabelModal' @@ -16,11 +16,11 @@ import LabelModal from '../Modals/Inputs/LabelModal' import { Add } from '@mui/icons-material' import { useQueryClient } from '@tanstack/react-query' import { - Type as ListType, - SwipeableList, - SwipeableListItem, - SwipeAction, - TrailingActions, + Type as ListType, + SwipeableList, + SwipeableListItem, + SwipeAction, + TrailingActions, } from 'react-swipeable-list' import 'react-swipeable-list/dist/styles.css' import { useUserProfile } from '../../queries/UserQueries' diff --git a/src/views/Modals/Inputs/DateModal.jsx b/src/views/Modals/Inputs/DateModal.jsx index da5ce7c..52ed0d1 100644 --- a/src/views/Modals/Inputs/DateModal.jsx +++ b/src/views/Modals/Inputs/DateModal.jsx @@ -1,5 +1,4 @@ -import { NextWeek, Today, WbSunny, Weekend } from '@mui/icons-material' -import { Box, Button, Chip, Input, Stack, Typography } from '@mui/joy' +import { Box, Button, Input } from '@mui/joy' import { useState } from 'react' import { useResponsiveModal } from '../../../hooks/useResponsiveModal' @@ -10,62 +9,6 @@ function DateModal({ isOpen, onClose, onSave, current, title }) { current ? new Date(current).toISOString().split('T')[0] : '', ) - const getQuickScheduleDate = option => { - const now = new Date() - const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()) - - switch (option) { - case 'today': { - const nowHour = now.getHours() - const scheduled = new Date(today) - if (nowHour < 9) { - scheduled.setHours(9, 0, 0, 0) - } else if (nowHour < 12) { - scheduled.setHours(12, 0, 0, 0) - } else if (nowHour < 17) { - scheduled.setHours(17, 0, 0, 0) - } else { - scheduled.setHours( - now.getHours(), - now.getMinutes(), - now.getSeconds(), - now.getMilliseconds(), - ) - } - return scheduled - } - case 'tomorrow': { - const tomorrow = new Date(today) - tomorrow.setDate(today.getDate() + 1) - tomorrow.setHours(12, 0, 0, 0) - return tomorrow - } - case 'weekend': { - const weekend = new Date(today) - const daysUntilSaturday = (6 - today.getDay() + 7) % 7 || 7 - weekend.setDate(today.getDate() + daysUntilSaturday) - return weekend - } - case 'next-week': { - const nextWeek = new Date(today) - const daysUntilMonday = (1 - today.getDay() + 7) % 7 || 7 - nextWeek.setDate(today.getDate() + daysUntilMonday) - return nextWeek - } - default: - return today - } - } - - const handleQuickSchedule = option => { - if (option === 'remove') { - setDate('') - } else { - const selectedDate = getQuickScheduleDate(option) - setDate(selectedDate.toISOString().split('T')[0]) - } - } - const handleSave = () => { onSave(date) onClose() @@ -86,7 +29,7 @@ function DateModal({ isOpen, onClose, onSave, current, title }) { onChange={e => setDate(e.target.value)} /> - + {/* Quick select: @@ -132,7 +75,7 @@ function DateModal({ isOpen, onClose, onSave, current, title }) { Next week - + */}