diff --git a/apps/app/components/core/modals/link-modal.tsx b/apps/app/components/core/modals/link-modal.tsx index 63a821dce..fc1641767 100644 --- a/apps/app/components/core/modals/link-modal.tsx +++ b/apps/app/components/core/modals/link-modal.tsx @@ -15,7 +15,7 @@ type Props = { onFormSubmit: (formData: IIssueLink | ModuleLink) => Promise; }; -const defaultValues: ModuleLink = { +const defaultValues: IIssueLink | ModuleLink = { title: "", url: "", }; @@ -30,9 +30,8 @@ export const LinkModal: React.FC = ({ isOpen, handleClose, onFormSubmit } defaultValues, }); - const onSubmit = async (formData: ModuleLink) => { - await onFormSubmit(formData); - + const onSubmit = async (formData: IIssueLink | ModuleLink) => { + await onFormSubmit({ title: formData.title, url: formData.url }); onClose(); }; @@ -87,7 +86,7 @@ export const LinkModal: React.FC = ({ isOpen, handleClose, onFormSubmit } label="URL" name="url" type="url" - placeholder="Enter URL" + placeholder="https://..." autoComplete="off" error={errors.url} register={register} @@ -99,16 +98,13 @@ export const LinkModal: React.FC = ({ isOpen, handleClose, onFormSubmit }
diff --git a/apps/app/components/core/sidebar/links-list.tsx b/apps/app/components/core/sidebar/links-list.tsx index 0d8a97298..e9f8e9039 100644 --- a/apps/app/components/core/sidebar/links-list.tsx +++ b/apps/app/components/core/sidebar/links-list.tsx @@ -55,7 +55,7 @@ export const LinksList: React.FC = ({ links, handleDeleteLink, userAuth }
-
{link.title}
+
{link.title ?? link.url}

Added {timeAgo(link.created_at)}