diff --git a/apps/namegraph.dev/app/explore-collections/page.tsx b/apps/namegraph.dev/app/explore-collections/page.tsx index 70ecd660..27766538 100644 --- a/apps/namegraph.dev/app/explore-collections/page.tsx +++ b/apps/namegraph.dev/app/explore-collections/page.tsx @@ -25,6 +25,8 @@ export default function ExploreCollectionsPage() { useEffect(() => { if (debouncedValue) { + setNameIdeas(null); + setNameIdeasLoading(true); getCollectionsForQuery(debouncedValue) .then((res) => setNameIdeas(res)) .finally(() => setNameIdeasLoading(false)); @@ -161,6 +163,12 @@ export default function ExploreCollectionsPage() { }; }, []); + useEffect(() => { + if (nameIdeas) { + setActiveQuickJumpPill(); + } + }, [nameIdeas]); + useEffect(() => { if (activeCategoryID) { clearActiveQuickJumpPills(); @@ -172,20 +180,6 @@ export default function ExploreCollectionsPage() { } }, [activeCategoryID]); - useEffect(() => { - const elm = document.getElementById("scrollable-elm"); - - console.log(elm); - - elm?.addEventListener("scroll", () => { - console.log(elm.scrollTop); - }); - - return elm?.removeEventListener("scroll", () => { - console.log(elm.scrollTop); - }); - }, []); - return (
@@ -196,15 +190,48 @@ export default function ExploreCollectionsPage() { 🔎 Search for a name and see name ideas ⬇️
- setDebouncedValue(e.target.value)} - className="w-full bg-gray-100 border border-gray-300 rounded-md p-3 px-4" - /> +
+ setDebouncedValue(e.target.value)} + className="w-full bg-gray-100 border border-gray-300 rounded-md p-3 px-4" + /> + {nameIdeasLoading ? ( +
+ + Loading... +
+ ) : debouncedValue ? ( + + ) : null} +

Use NameGraph SDK to generate multiple name ideas suggestions for a single search. This works just as typing something like{" "} @@ -245,6 +272,7 @@ export default function ExploreCollectionsPage() { `} > diff --git a/apps/namegraph.dev/components/mini-apps/explore-collections/quick-jumps-by-category.tsx b/apps/namegraph.dev/components/mini-apps/explore-collections/quick-jumps-by-category.tsx index 183c02d9..433a8441 100644 --- a/apps/namegraph.dev/components/mini-apps/explore-collections/quick-jumps-by-category.tsx +++ b/apps/namegraph.dev/components/mini-apps/explore-collections/quick-jumps-by-category.tsx @@ -13,11 +13,13 @@ import { } from "@/lib/utils"; interface QuickJumpsByCategoryProps { + search: string; activeCategoryID: string; nameIdeas: null | NameGraphGroupedByCategoryResponse; } export const QuickJumpsByCategory = ({ + search, nameIdeas, activeCategoryID, }: QuickJumpsByCategoryProps) => { @@ -60,12 +62,16 @@ export const QuickJumpsByCategory = ({ } }, [quickJumpCategories]); + useEffect(() => { + setLoadingQuickJumpPills(true); + }, [search]); + if (nameIdeas?.categories === null) return null; return (

- 📚 Collections and name ideas found ⬇️ + 📚 Collections and name ideas found for {search} ⬇️

{!quickJumpCategories || loadingQuickJumpPills ? (
diff --git a/apps/namegraph.dev/components/mini-apps/ideate/writers-block-pill.tsx b/apps/namegraph.dev/components/mini-apps/ideate/writers-block-pill.tsx index abbfb78c..27425e7c 100644 --- a/apps/namegraph.dev/components/mini-apps/ideate/writers-block-pill.tsx +++ b/apps/namegraph.dev/components/mini-apps/ideate/writers-block-pill.tsx @@ -9,7 +9,7 @@ export const WritersBlockPill = ({ suggestion: WritersBlockSuggestion | null; }) => { return ( - +
); };