diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx index aaac3cc798c..9d2112e7ed8 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx @@ -23,6 +23,7 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { ImageUpload } from "@/components/ui/image-upload"; +import { Input } from "@/components/ui/input"; import { Skeleton } from "@/components/ui/skeleton"; import { useThirdwebClient } from "@/constants/thirdweb.client"; import { useDashboardRouter } from "@/lib/DashboardRouter"; @@ -159,6 +160,10 @@ export function EcosystemHeader(props: { const [isDialogOpen, setIsDialogOpen] = useState(false); const [selectedFile, setSelectedFile] = useState(null); + // Name editing state + const [isNameDialogOpen, setIsNameDialogOpen] = useState(false); + const [tempName, setTempName] = useState(ecosystem.name); + const storageUpload = useDashboardStorageUpload(); const router = useDashboardRouter(); @@ -170,7 +175,7 @@ export function EcosystemHeader(props: { }, { onSuccess: () => { - toast.success("Ecosystem image updated"); + toast.success("Ecosystem updated"); setIsDialogOpen(false); router.refresh(); }, @@ -209,6 +214,25 @@ export function EcosystemHeader(props: { } } + async function handleNameSave() { + const trimmed = tempName.trim(); + if (!trimmed || trimmed === ecosystem.name) { + setIsNameDialogOpen(false); + return; + } + try { + await updateEcosystem({ + ...ecosystem, + name: trimmed, + }); + setIsNameDialogOpen(false); + router.refresh(); + } catch (err) { + console.error(err); + toast.error("Failed to update name"); + } + } + return (
@@ -296,6 +320,52 @@ export function EcosystemHeader(props: { ) : (

{ecosystem.name} + + + + + + + + Edit Ecosystem Name + + +
+ setTempName(e.target.value)} + /> +
+ + + + + + + +
+

)} {!ecosystem.slug ? ( @@ -306,7 +376,7 @@ export function EcosystemHeader(props: { textToCopy={`ecosystem.${ecosystem.slug}`} textToShow={`ecosystem.${ecosystem.slug}`} copyIconPosition="right" - tooltip="Copy Ecosytem slug" + tooltip="Copy Ecosystem slug" variant="ghost" className="-translate-x-2 px-2 py-0.5 text-muted-foreground" />