Skip to content

Commit cc1e08d

Browse files
Merge branch 'main' of https://github.com/the-collab-lab/tcl-74-smart-shopping-list into dtp-teampage
2 parents 591218a + bf044ad commit cc1e08d

File tree

11 files changed

+1655
-58
lines changed

11 files changed

+1655
-58
lines changed

package-lock.json

Lines changed: 903 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"react-dom": "^18.3.1",
1515
"react-icons": "^5.3.0",
1616
"react-router-dom": "^6.26.0",
17-
"react-toastify": "^10.0.5",
18-
"react-type-animation": "^3.2.0"
17+
"react-toastify": "^10.0.5"
1918
},
2019
"devDependencies": {
2120
"@nabla/vite-plugin-eslint": "^2.0.4",
@@ -32,6 +31,7 @@
3231
"jsdom": "^24.1.1",
3332
"lint-staged": "^15.2.8",
3433
"prettier": "^3.3.3",
34+
"tailwindcss": "^3.4.13",
3535
"vite": "^5.3.5",
3636
"vite-plugin-pwa": "^0.20.1",
3737
"vite-plugin-svgr": "^4.2.0",

src/api/firebase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export async function shareList(listPath, currentUserId, recipientEmail) {
173173
sharedLists: arrayUnion(listDocumentRef),
174174
});
175175
return Promise.resolve(
176-
`You have successfully shared your list to ${recipientEmail}`,
176+
`You have successfully shared your list to: \n${recipientEmail}`,
177177
);
178178
}
179179

src/components/ListItem.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useEffect, useState } from 'react';
22
import { useToggle } from '@uidotdev/usehooks';
33
import { Toggle } from './Toggle.jsx';
4+
import { notify } from '../utils/notifications';
45
import './ListItem.css';
56
import { updateItem, deleteItem } from '../api/firebase.js';
67
import { FaTrashAlt } from 'react-icons/fa';
@@ -15,7 +16,6 @@ export function ListItem({
1516
purchaseInterval,
1617
dateCreated,
1718
sortCriteria,
18-
setMessage,
1919
}) {
2020
const [purchased, setPurchased] = useToggle(false);
2121
const [isDisabled, setIsDisabled] = useState(false);
@@ -55,7 +55,7 @@ export function ListItem({
5555
dateCreated,
5656
});
5757
console.log(`${name} updated successfully`);
58-
alert(`${name} is purchased successfully`);
58+
notify(`${name} has been purchased successfully!`, 'success');
5959
setIsDisabled(true);
6060
} catch (error) {
6161
console.error('Error updating item:', error);
@@ -64,7 +64,6 @@ export function ListItem({
6464
}
6565
};
6666

67-
// handleDelete Function
6867
const handleDelete = async () => {
6968
const deleteConfirm = window.confirm(
7069
`Are you sure you want to delete ${name}?`,
@@ -73,7 +72,7 @@ export function ListItem({
7372
if (deleteConfirm) {
7473
try {
7574
await deleteItem(listPath, itemId);
76-
setMessage(`${name} has been deleted successfully!`);
75+
notify(`${name} has been deleted successfully!`, 'success');
7776
} catch (error) {
7877
console.log(`Error:`, error);
7978
}
@@ -95,15 +94,11 @@ export function ListItem({
9594
{name}
9695

9796
<div className={urgencyClass}>{sortCriteria.tag}</div>
98-
{/* <RiDeleteBin5Fill onClick={handleDelete} aria-label={`Delete ${name}`}>
99-
Delete
100-
</RiDeleteBin5Fill> */}
10197

10298
<IconButton
10399
aria-label={`Delete ${name}`}
104100
as="button"
105101
className="delete-icon"
106-
// label="Add"
107102
IconComponent={FaTrashAlt}
108103
onClick={handleDelete}
109104
/>

src/index.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
15
:root {
26
--color-black: hsla(220, 13%, 18%, 1);
37
--color-gray-dark: hsla(220, 13%, 25%, 1);
@@ -14,7 +18,6 @@
1418
--color-border: hsla(220, 13%, 32%, 1);
1519
--color-error: var(--color-red);
1620
--color-text: var(--color-white);
17-
1821
/**
1922
* Set the value of 1rem to 10px to make relative units
2023
* easier to work with.
@@ -99,3 +102,7 @@ code {
99102
:root.theme-light code {
100103
--color-bg: var(--color-gray-light);
101104
}
105+
106+
.share-div {
107+
padding-bottom: 100px;
108+
}

0 commit comments

Comments
 (0)