diff --git a/src/views/ChoreEdit/ChoreView.jsx b/src/views/ChoreEdit/ChoreView.jsx index d28d08a..2f97da1 100644 --- a/src/views/ChoreEdit/ChoreView.jsx +++ b/src/views/ChoreEdit/ChoreView.jsx @@ -11,12 +11,12 @@ import { PeopleAlt, Person, SwitchAccessShortcut, - Timelapse, } from '@mui/icons-material' import { Box, Button, Card, + CardContent, Checkbox, Chip, Container, @@ -25,8 +25,6 @@ import { Grid, IconButton, Input, - ListItem, - ListItemContent, Menu, MenuButton, MenuItem, @@ -121,62 +119,43 @@ const ChoreView = () => { { size: 6, icon: , - text: 'Assigned To', - subtext: performers.find(p => p.id === chore.assignedTo)?.displayName, + title: 'Assignment', + text: `Assigned: ${ + performers.find(p => p.id === chore.assignedTo)?.displayName || 'N/A' + }`, + subtext: ` Last: ${ + chore.lastCompletedDate + ? performers.find(p => p.id === chore.lastCompletedBy)?.displayName + : '--' + }`, }, { size: 6, icon: , - text: 'Due Date', - subtext: chore.nextDueDate - ? moment(chore.nextDueDate).fromNow() - : 'N/A', + title: 'Schedule', + text: `Due: ${ + chore.nextDueDate ? moment(chore.nextDueDate).fromNow() : 'N/A' + }`, + subtext: `Last: ${ + chore.lastCompletedDate + ? moment(chore.lastCompletedDate).fromNow() + : 'N/A' + }`, }, - - // { - // icon: , - // text: 'Frequency', - // subtext: - // chore.frequencyType.charAt(0).toUpperCase() + - // chore.frequencyType.slice(1), - // }, { size: 6, icon: , - text: 'Total Completed', - subtext: `${chore.totalCompletedCount} times`, - }, - { - size: 6, - icon: , - text: 'Last Completed', - subtext: - // chore.lastCompletedDate && - // moment(chore.lastCompletedDate).format('MM/DD/YYYY hh:mm A'), - chore.lastCompletedDate && moment(chore.lastCompletedDate).fromNow(), + title: 'Statistics', + text: `Completed: ${chore.totalCompletedCount || 0} times`, }, { size: 6, icon: , - text: 'Last Performer', - subtext: chore.lastCompletedDate - ? `${ - performers.find(p => p.id === chore.lastCompletedBy)?.displayName - }` - : '--', + title: 'Details', + subtext: `Created By: ${ + performers.find(p => p.id === chore.createdBy)?.displayName || 'N/A' + }`, }, - { - size: 6, - icon: , - text: 'Created By', - subtext: performers.find(p => p.id === chore.createdBy)?.displayName, - }, - // { - // size: 12, - // icon: , - // text: 'Recent Note', - // subtext: chore.notes || '--', - // }, ] setInfoCards(cards) } @@ -287,38 +266,70 @@ const ChoreView = () => { ))} + - - - {infoCards.map((detail, index) => ( - - {/* divider between the list items: */} + {infoCards.map((card, index) => ( + + + + + {card.icon} - - - - {detail.text} - - - {detail.subtext ? detail.subtext : '--'} - - - - - ))} - - + {card.title} + + + + + {card.text} + + + {card.subtext} + + + + + + ))} + { p: 1, }} fullWidth + variant='plain' > {chorePriority ? chorePriority.icon : } {chorePriority ? chorePriority.name : 'No Priority'} @@ -388,7 +400,7 @@ const ChoreView = () => { + onEditClick(thing)} + sx={{ + borderRadius: '50%', + width: 30, + height: 30, + ml: 1, + transition: 'background-color 0.2s', + '&:hover': { backgroundColor: 'action.hover' }, + }} + > + + + onDeleteClick(thing)} + sx={{ + borderRadius: '50%', + width: 30, + height: 30, + ml: 1, + }} + > + + - + ) } diff --git a/src/views/components/NavBar.jsx b/src/views/components/NavBar.jsx index c4c4276..0425cb6 100644 --- a/src/views/components/NavBar.jsx +++ b/src/views/components/NavBar.jsx @@ -105,22 +105,22 @@ const NavBar = () => { } return ( -