Replace the landing with the artifact design and rebuild the admin in Ant Design.
Adds consultation leads, section editors, and the one-time content reset for this release. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { Ref } from "vue";
|
||||
|
||||
/** Calls `handler` on Escape while `active` is true. */
|
||||
export function useEscapeKey(active: Ref<boolean>, handler: () => void) {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") handler();
|
||||
};
|
||||
watch(
|
||||
active,
|
||||
(on) => {
|
||||
if (!import.meta.client) return;
|
||||
if (on) document.addEventListener("keydown", onKey);
|
||||
else document.removeEventListener("keydown", onKey);
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
onBeforeUnmount(() => document.removeEventListener("keydown", onKey));
|
||||
}
|
||||
Reference in New Issue
Block a user