From dac172a5c512603cb78fe0fea9cc6916790bbb76 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 4 Jun 2022 16:19:41 +0430 Subject: [PATCH] Bug fix. --- src/componets/EditItem.js | 10 ++++------ src/componets/List.js | 2 +- src/modules/send.js | 4 ++-- src/styles/EditItem.css | 0 src/styles/List.css | 9 ++++++--- 5 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 src/styles/EditItem.css diff --git a/src/componets/EditItem.js b/src/componets/EditItem.js index 17a1ae7..df39c4c 100644 --- a/src/componets/EditItem.js +++ b/src/componets/EditItem.js @@ -4,20 +4,18 @@ import '../styles/AddItem.css'; import TagSelection from './TagSelection'; import editItem from '../modules/send'; -// deleteEntity(e._id, reFetch) - const EditItem = ({tags, item, onExit, SetLoader, reFetch}) => { const [name, setName] = useState(item.name); const [tag, setTag] = useState(item.tag); function EditItem() { - SetLoader(true) - editItem(name, item.link, tag, reFetch, onExit, SetLoader, "PUT", item._id); + SetLoader(true); + editItem(name, item.link, tag, reFetch, onExit, SetLoader, "PUT", item._id, item.title); } function deleteItem() { - SetLoader(true) - deleteEntity(item._id, reFetch, onExit, SetLoader) + SetLoader(true); + deleteEntity(item._id, reFetch, onExit, SetLoader); } function SetName(e) { diff --git a/src/componets/List.js b/src/componets/List.js index 28475ba..a163cbf 100644 --- a/src/componets/List.js +++ b/src/componets/List.js @@ -42,7 +42,7 @@ const List = ({data, tags, reFetch, SetLoader}) => {
- +
) diff --git a/src/modules/send.js b/src/modules/send.js index fa1b0a2..a21ab01 100644 --- a/src/modules/send.js +++ b/src/modules/send.js @@ -1,7 +1,7 @@ import config from '../config'; import { nanoid } from 'nanoid'; -const addItem = async (name, link, tag, reFetch, onExit, SetLoader, method, id=nanoid()) => { +const addItem = async (name, link, tag, reFetch, onExit, SetLoader, method, id=nanoid(), title='') => { function isValidHttpUrl(string) { let url; @@ -21,7 +21,7 @@ const addItem = async (name, link, tag, reFetch, onExit, SetLoader, method, id=n body: JSON.stringify({ _id: id, name: name, - title: '', + title: title, link: link, tag: tag }), diff --git a/src/styles/EditItem.css b/src/styles/EditItem.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/styles/List.css b/src/styles/List.css index 864c421..4b8bb64 100644 --- a/src/styles/List.css +++ b/src/styles/List.css @@ -72,10 +72,10 @@ border-radius: 100%; margin: 20px 20px 20px 0px; font-family: 'Font Awesome 5 Free'; - width: 40px; - height: 40px; + width: 50px; + height: 50px; padding: 10px; - font-size: 1.1rem; + font-size: 1.3rem; cursor: pointer; box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset; color: #ffffffb6; @@ -126,6 +126,9 @@ .delete { float: right; + font-size: 1.1rem; + width: 40px; + height: 40px; } .delete:hover {