fix: hashtag extraction and make remote links absolute

This commit is contained in:
2023-08-02 15:05:35 +02:00
parent 2d56710223
commit cebbb8af2b
9 changed files with 253 additions and 99 deletions

View File

@@ -34,6 +34,7 @@ export const KMenu = (
const activeState = useSignal<"normal" | "loading" | "error" | "input">(
"normal",
);
const loadingText = useSignal("");
const activeIndex = useSignal(-1);
const input = useRef<HTMLInputElement>(null);
@@ -74,6 +75,7 @@ export const KMenu = (
menuEntry.cb({
activeMenu: activeMenuType,
loadingText,
menus,
activeState,
commandInput,
@@ -133,8 +135,14 @@ export const KMenu = (
class={`relative w-1/2 max-h-64 max-w-[400px] rounded-2xl shadow-2xl nnoisy-gradient overflow-hidden after:opacity-10 bg-gray-700`}
>
<div
class="grid h-12 text-gray-400 border-b border-gray-500 "
style={{ gridTemplateColumns: "4em 1fr" }}
class={`grid h-12 text-gray-400 ${
activeState.value !== "loading" && "border-b"
} border-gray-500 `}
style={{
gridTemplateColumns: activeState.value !== "loading"
? "4em 1fr"
: "1fr",
}}
>
{(activeState.value === "normal" || activeState.value === "input") &&
(
@@ -156,8 +164,9 @@ export const KMenu = (
</>
)}
{activeState.value === "loading" && (
<div class="p-4">
Loading...
<div class="py-3 px-4 flex items-center gap-2">
<icons.IconLoader2 class="animate-spin w-4 h-4" />
{loadingText.value || "Loading..."}
</div>
)}
</div>