Skip to content

Commit 9091e81

Browse files
committed
added invite team button in dash homepage (#6751)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a new `ShareButton` component to the `TeamProjectsPage`, allowing users to invite team members. It also tracks the button click event for analytics and includes a link to the team members settings. ### Detailed summary - Added `ShareButton` component for inviting team members. - Integrated `useTrack` hook to track button click events. - Added a link to the team members settings using `Link`. - Imported `UserPlus` icon from `lucide-react`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 23d3757 commit 9091e81

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>to 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)