feat: added links update functionality
This commit is contained in:
@@ -16,6 +16,8 @@ export default function EditLink({ toggleLinkModal, link }: Props) {
|
||||
|
||||
const { updateLink } = useLinkStore();
|
||||
|
||||
const shortendURL = new URL(link.url).host.toLowerCase();
|
||||
|
||||
const setTags = (e: any) => {
|
||||
const tagNames = e.map((e: any) => {
|
||||
return { name: e.label };
|
||||
@@ -40,8 +42,9 @@ export default function EditLink({ toggleLinkModal, link }: Props) {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<p className="font-bold text-sky-300 mb-2 text-center">New Link</p>
|
||||
|
||||
<p className="font-bold text-sky-300 mb-2 text-center">Edit Link</p>
|
||||
<p>{shortendURL}</p>
|
||||
<p>{link.title}</p>
|
||||
<div className="flex gap-5 items-center justify-between">
|
||||
<p className="text-sm font-bold text-sky-300">Name</p>
|
||||
<input
|
||||
@@ -55,19 +58,6 @@ export default function EditLink({ toggleLinkModal, link }: Props) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-5 items-center justify-between">
|
||||
<p className="text-sm font-bold text-sky-300">URL</p>
|
||||
<input
|
||||
value={currentLink.url}
|
||||
onChange={(e) =>
|
||||
setCurrentLink({ ...currentLink, url: e.target.value })
|
||||
}
|
||||
type="text"
|
||||
placeholder="e.g. http://example.com/"
|
||||
className="w-60 rounded-md p-3 border-sky-100 border-solid border text-sm outline-none focus:border-sky-500 duration-100"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-5 items-center justify-between">
|
||||
<p className="text-sm font-bold text-sky-300">Tags</p>
|
||||
<TagSelection
|
||||
|
||||
Reference in New Issue
Block a user