Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add D keyboard shortcut

Steven Teyd8f9e56d9566
diff --git a/apps/web/ui/links/short-link-input-new.tsx b/apps/web/ui/links/short-link-input-new.tsx
index 3e0e9152aa..89dc7e9eba 100644
--- a/apps/web/ui/links/short-link-input-new.tsx
+++ b/apps/web/ui/links/short-link-input-new.tsx
@@ -11,6 +11,7 @@ import {
Magic,
Tooltip,
Twitter,
+ useKeyboardShortcut,
} from "@dub/ui";
import { ArrowTurnRight2 } from "@dub/ui/src/icons";
import {
@@ -171,6 +172,10 @@ export const ShortLinkInputNew = forwardRef<
});
}, [key, domain]);
+ const [isOpen, setIsOpen] = useState(false);
+
+ useKeyboardShortcut("d", () => setIsOpen(true), { modal: true });
+
return (
<div>
<div className="flex items-center justify-between">
@@ -280,12 +285,15 @@ export const ShortLinkInputNew = forwardRef<
)
}
searchPlaceholder="Search domains..."
+ shortcutHint="D"
buttonProps={{
className: cn(
- "w-24 sm:w-32 lg:w-36 h-full rounded-r-none border-r-0 justify-start px-2.5",
+ "min-w-24 sm:min-w-32 h-full rounded-r-none border-r-0 justify-start px-2.5",
!key && "text-gray-600",
),
}}
+ open={isOpen}
+ onOpenChange={setIsOpen}
/>
</div>
<input