Skip to content

Commit 8a6c5e1

Browse files
author
Nika Kolesnikova
committed
feat: update ListItem imports and remove redundant console log
1 parent 4c88cf1 commit 8a6c5e1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/components/ListItem.jsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { updateItem, deleteItem } from '../api';
33
import { calculateDateNextPurchased, ONE_DAY_IN_MILLISECONDS } from '../utils';
44
import { toast } from 'react-toastify';
55
import { useConfirmDialog } from '../hooks/useConfirmDialog';
6-
import { ConfirmDialog } from './ConfirmDialog';
7-
import { DeleteIconWithTooltip, tooltipStyle } from './DeleteIconWithTooltip';
6+
import { DeleteIconWithTooltip, tooltipStyle, ConfirmDialog } from './index';
87
import {
98
ListItem as MaterialListItem,
109
Tooltip,
@@ -39,12 +38,6 @@ const urgencyStatusStyle = {
3938
color: 'white',
4039
};
4140

42-
const toolTipStyle = {
43-
fontSize: '1.5rem',
44-
marginBlockStart: '0',
45-
marginBlockEnd: '0',
46-
};
47-
4841
const calculateIsPurchased = (dateLastPurchased) => {
4942
if (!dateLastPurchased) {
5043
return false;
@@ -86,7 +79,6 @@ export function ListItem({ item, listPath, itemUrgencyStatus }) {
8679
};
8780

8881
const handleDeleteItem = async () => {
89-
console.log('attempting item deletion');
9082
try {
9183
await deleteItem(listPath, id);
9284
toast.success('Item deleted');
@@ -102,7 +94,7 @@ export function ListItem({ item, listPath, itemUrgencyStatus }) {
10294
handleDelete: handleDeleteItem,
10395
title: `Are you sure you want to delete ${name}?`,
10496
setOpen: isOpen,
105-
open: open,
97+
open,
10698
};
10799

108100
const tooltipTitle = isPurchased
@@ -115,7 +107,7 @@ export function ListItem({ item, listPath, itemUrgencyStatus }) {
115107
<MaterialListItem className="ListItem">
116108
{UrgencyStatusIcon && (
117109
<Tooltip
118-
title={<p style={toolTipStyle}>{itemUrgencyStatus}</p>}
110+
title={<p style={tooltipStyle}>{itemUrgencyStatus}</p>}
119111
placement="left"
120112
arrow
121113
>

0 commit comments

Comments
 (0)