The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix tag creation issue when no tags
Steven Tey37634e5c1fdf
diff --git a/components/app/links/link-card.tsx b/components/app/links/link-card.tsxindex 2139184377..94dccb1392 100644--- a/components/app/links/link-card.tsx+++ b/components/app/links/link-card.tsx@@ -133,6 +133,7 @@ export default function LinkCard({ props }: { props: LinkProps }) {shortcuts.includes(e.key)) {setSelected(false);+ e.preventDefault();switch (e.key) {case "e":setShowAddEditLinkModal(true);diff --git a/components/app/modals/add-edit-link-modal/tags-section.tsx b/components/app/modals/add-edit-link-modal/tags-section.tsxindex d25f561033..b665954364 100644--- a/components/app/modals/add-edit-link-modal/tags-section.tsx+++ b/components/app/modals/add-edit-link-modal/tags-section.tsx@@ -82,7 +82,7 @@ export default function TagsSection({// hack to focus on the input when the dropdown opensautoFocus={openCommandList}// when focus on the input. only show the dropdown if there are tags and the tagValue is not empty- onFocus={() => tags && tags.length > 0 && setOpenCommandList(true)}+ onFocus={() => setOpenCommandList(true)}value={inputValue}onValueChange={setInputValue}onKeyDown={(e) => {@@ -138,8 +138,13 @@ export default function TagsSection({}}className="absolute z-20 h-[300px] w-full animate-input-select-slide-up overflow-auto rounded-md border border-gray-200 bg-white p-2 shadow-md transition-all sm:h-[calc(var(--cmdk-list-height)+17px)] sm:max-h-[300px] sm:animate-input-select-slide-down">+ {tags?.length === 0 && inputValue.length === 0 && (+ <p className="px-4 py-2.5 text-sm text-gray-900">+ Start typing to create tag...+ </p>+ )}<Command.Empty>- {inputValue.length > 0 ? (+ {inputValue.length > 0 && (<buttononClick={() => createTag(inputValue)}className="flex w-full cursor-pointer items-center rounded-md bg-gray-100 px-4 py-2 text-sm text-gray-900 hover:text-gray-900 aria-selected:bg-gray-100 aria-selected:text-gray-900"@@ -149,8 +154,6 @@ export default function TagsSection({{inputValue}</span></button>- ) : (- <p className="py-0.5">Start typing to create tag...</p>)}</Command.Empty>{tags?.map((tag) => (diff --git a/components/app/modals/delete-account-modal.tsx b/components/app/modals/delete-account-modal.tsxindex 82ede51196..ae7f80de31 100644--- a/components/app/modals/delete-account-modal.tsx+++ b/components/app/modals/delete-account-modal.tsx@@ -104,6 +104,7 @@ function DeleteAccountModal({pattern="confirm delete account"requiredautoFocus={false}+ autoComplete="off"className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"/></div>diff --git a/components/app/modals/delete-link-modal.tsx b/components/app/modals/delete-link-modal.tsxindex 52ceb907d5..12a9172be4 100644--- a/components/app/modals/delete-link-modal.tsx+++ b/components/app/modals/delete-link-modal.tsx@@ -111,6 +111,7 @@ function DeleteLinkModal({pattern={shortlink}requiredautoFocus+ autoComplete="off"className="block w-full rounded-md border-gray-300 pr-10 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm"/></div>