fix: update chore ID reference in ChoresOverview and clean up unused code in HistoryDetailModal and AdvancedOptionsSection
This commit is contained in:
@@ -22,10 +22,10 @@ import {
|
||||
Tooltip,
|
||||
Typography,
|
||||
} from '@mui/joy'
|
||||
|
||||
import moment from 'moment'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import { GetAllUsers, GetChores, MarkChoreComplete } from '../utils/Fetcher'
|
||||
import DateModal from './Modals/Inputs/DateModal'
|
||||
// import moment from 'moment'
|
||||
@@ -330,7 +330,7 @@ const ChoresOverview = () => {
|
||||
response.json().then(data => {
|
||||
const newChore = data.res
|
||||
const newChores = [...chores]
|
||||
const index = newChores.findIndex(c => c.id === chore.id)
|
||||
const index = newChores.findIndex(c => c.id === choreId)
|
||||
newChores[index] = newChore
|
||||
setChores(newChores)
|
||||
setFilteredChores(newChores)
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Avatar, Box, Button, Chip, Divider, Stack, Typography } from '@mui/joy'
|
||||
import moment from 'moment'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
|
||||
import ModalActions from '../../components/common/ModalActions'
|
||||
import { useLocalization } from '../../contexts/LocalizationContext'
|
||||
import { useResponsiveModal } from '../../hooks/useResponsiveModal'
|
||||
@@ -44,7 +45,7 @@ const STATUS_CONFIG = {
|
||||
6: { labelKey: 'status.rescheduled', color: 'warning', icon: <Schedule /> },
|
||||
}
|
||||
|
||||
const DetailRow = ({ icon, label, value, children }) => (
|
||||
const DetailRow = ({ children, icon, label, value }) => (
|
||||
<Box sx={{ display: 'flex', alignItems: 'flex-start', gap: 1.5, py: 0.75 }}>
|
||||
<Box
|
||||
sx={{ color: 'text.tertiary', mt: 0.25, flexShrink: 0, display: 'flex' }}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MoreVert } from '@mui/icons-material'
|
||||
import { Card, IconButton, Typography } from '@mui/joy'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@@ -8,9 +9,7 @@ const SummaryCard = () => {
|
||||
<div className='flex justify-between'>
|
||||
<div>
|
||||
<Typography level='h2'>Summary</Typography>
|
||||
<Typography level='body-xs'>
|
||||
{t('summaryOfChores')}
|
||||
</Typography>
|
||||
<Typography level='body-xs'>{t('summaryOfChores')}</Typography>
|
||||
</div>
|
||||
<IconButton>
|
||||
<MoreVert />
|
||||
|
||||
@@ -1181,7 +1181,10 @@ const TaskInput = ({ initialMode, isModalOpen, onChoreUpdate, onClose }) => {
|
||||
</MenuButton>
|
||||
<Menu
|
||||
placement='top-start'
|
||||
sx={{ minWidth: 200, zIndex: Z_INDEX.MODAL_POPOVER }}
|
||||
sx={{
|
||||
minWidth: 200,
|
||||
zIndex: 'calc(var(--joy-zIndex-modal) + 1)',
|
||||
}}
|
||||
>
|
||||
{[DEFAULT_PROJECT, ...projects].map(project => {
|
||||
const ProjectIcon = getIconComponent(project.icon)
|
||||
|
||||
@@ -312,28 +312,6 @@ const AdvancedOptionsSection = ({
|
||||
/>
|
||||
</FieldRow>
|
||||
|
||||
<FieldRow
|
||||
label='Expires after'
|
||||
description='Hours after the due date when the task can no longer be completed'
|
||||
>
|
||||
<Input
|
||||
type='number'
|
||||
size='sm'
|
||||
placeholder='—'
|
||||
value={deadlineOffset > -1 ? deadlineOffset : ''}
|
||||
onChange={e => {
|
||||
const v = parseInt(e.target.value)
|
||||
onDeadlineOffsetChange(isNaN(v) ? -1 : Math.max(0, v))
|
||||
}}
|
||||
endDecorator={
|
||||
<Typography level='body-xs' textColor='text.tertiary'>
|
||||
hrs
|
||||
</Typography>
|
||||
}
|
||||
sx={{ width: 96 }}
|
||||
slotProps={{ input: { min: 0 } }}
|
||||
/>
|
||||
</FieldRow>
|
||||
</>
|
||||
) : (
|
||||
<Typography
|
||||
|
||||
Reference in New Issue
Block a user