Skip to content

Commit 91fdb85

Browse files
committed
added invite team button in dash homepage
1 parent 22090cc commit 91fdb85

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

apps/dashboard/src/app/team/[team_slug]/(team)/~/projects/TeamProjectsPage.tsx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import { useDashboardRouter } from "@/lib/DashboardRouter";
2626
import { cn } from "@/lib/utils";
2727
import { LazyCreateProjectDialog } from "components/settings/ApiKeys/Create/LazyCreateAPIKeyDialog";
2828
import { formatDate } from "date-fns";
29-
import { PlusIcon, SearchIcon } from "lucide-react";
29+
import { useTrack } from "hooks/analytics/useTrack";
30+
import { PlusIcon, SearchIcon, UserPlus } from "lucide-react";
3031
import Link from "next/link";
3132
import { useMemo, useState } from "react";
3233
import type { ThirdwebClient } from "thirdweb";
@@ -119,6 +120,9 @@ export function TeamProjectsPage(props: {
119120
createProject={() => setIsCreateProjectDialogOpen(true)}
120121
teamMembersSettingsPath={`/team/${props.team.slug}/~/settings/members`}
121122
/>
123+
<Link href={`/team/${props.team.slug}/~/settings/members`}>
124+
<ShareButton />
125+
</Link>
122126
</div>
123127
</div>
124128
</div>
@@ -279,6 +283,29 @@ function AddNewButton(props: {
279283
);
280284
}
281285

286+
function ShareButton() {
287+
//track event click
288+
const trackEvent = useTrack();
289+
return (
290+
<Button
291+
variant="default"
292+
className="absolute top-0 right-0 gap-2 lg:static"
293+
onClick={() =>
294+
trackEvent({
295+
category: "inviteTeam",
296+
action: "click",
297+
label: "invite-team",
298+
})
299+
}
300+
>
301+
<UserPlus className="size-4" />
302+
<span>
303+
<span className="hidden lg:inline">Invite</span> Team
304+
</span>
305+
</Button>
306+
);
307+
}
308+
282309
function SelectBy(props: {
283310
value: SortById;
284311
onChange: (value: SortById) => void;

0 commit comments

Comments
 (0)