diff --git a/package-lock.json b/package-lock.json index 4800588..7cd576a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-hot-toast": "^2.4.1", + "react-icon": "^1.0.0", "react-icons": "^5.3.0", "react-router-dom": "^6.26.0", "tailwind-merge": "^2.5.2", @@ -5059,6 +5060,16 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, + "node_modules/babel-runtime": { + "version": "5.8.38", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.38.tgz", + "integrity": "sha512-KpgoA8VE/pMmNCrnEeeXqFG24TIH11Z3ZaimIhJWsin8EbfZy3WzFKUTIan10ZIDgRVvi9EkLbruJElJC9dRlg==", + "license": "MIT", + "peer": true, + "dependencies": { + "core-js": "^1.0.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -5463,6 +5474,14 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "node_modules/core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha512-ZiPp9pZlgxpWRu0M+YWbm6+aQ84XEfH1JRXvfOc/fILWI0VKhLC2LX13X1NYq4fULzLMq7Hfh43CSo2/aIaUPA==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "license": "MIT", + "peer": true + }, "node_modules/core-js-compat": { "version": "3.38.1", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", @@ -9049,6 +9068,16 @@ "react-dom": ">=16" } }, + "node_modules/react-icon": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/react-icon/-/react-icon-1.0.0.tgz", + "integrity": "sha512-VzSlpBHnLanVw79mOxyq98hWDi6DlxK9qPiZ1bAK6bLurMBCaxO/jjyYUrRx9+JGLc/NbnwOmyE/W5Qglbb2QA==", + "license": "MIT", + "peerDependencies": { + "babel-runtime": "^5.3.3", + "react": ">=0.12.0" + } + }, "node_modules/react-icons": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.3.0.tgz", diff --git a/package.json b/package.json index 847f893..576a040 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-hot-toast": "^2.4.1", + "react-icon": "^1.0.0", "react-icons": "^5.3.0", "react-router-dom": "^6.26.0", "tailwind-merge": "^2.5.2", diff --git a/src/components/ManageListForms/AddItemForm.jsx b/src/components/ManageListForms/AddItemForm.jsx index 5409e3f..2406320 100644 --- a/src/components/ManageListForms/AddItemForm.jsx +++ b/src/components/ManageListForms/AddItemForm.jsx @@ -30,7 +30,8 @@ export default function AddItemForm({ listPath, data, handleOpenModal }) { const formattedItemName = formData.itemName .toLowerCase() - .replace(/[^a-z]/g, ''); + .replace(/^\s\s*/, '') + .replace(/\s\s*$/, ''); const match = data.find((item) => item.name === formattedItemName);