Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"use client";

import { Button } from "@/components/ui/button";
import { useTrack } from "hooks/analytics/useTrack";
import { UserPlusIcon } from "lucide-react";
import Link from "next/link";

export function InviteTeamMembersButton(props: { teamSlug: string }) {
const trackEvent = useTrack();
return (
<Button
asChild
variant="outline"
className="gap-2"
onClick={() =>
trackEvent({
category: "inviteTeam",
action: "click",
label: "invite-team",
})
}
>
<Link href={`/team/${props.teamSlug}/~/settings/members`}>
<UserPlusIcon className="size-4" />
<span>Invite Team Members</span>
</Link>
</Button>
);
}
14 changes: 9 additions & 5 deletions apps/dashboard/src/app/team/[team_slug]/(team)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { subDays } from "date-fns";
import { redirect } from "next/navigation";
import { getAuthToken } from "../../../api/lib/getAuthToken";
import { loginRedirect } from "../../../login/loginRedirect";
import { InviteTeamMembersButton } from "./_components/invite-team-members-button";
import {
type ProjectWithAnalytics,
TeamProjectsPage,
Expand Down Expand Up @@ -33,11 +34,14 @@ export default async function Page(props: {

return (
<div className="flex grow flex-col">
<div className="border-border border-b py-10">
<div className="container">
<h1 className="font-semibold text-3xl tracking-tight">
Team Overview
</h1>
<div className="border-border border-b">
<div className="container flex flex-col items-start gap-3 py-10 md:flex-row md:items-center">
<div className="flex-1">
<h1 className="font-semibold text-3xl tracking-tight">
Team Overview
</h1>
</div>
<InviteTeamMembersButton teamSlug={params.team_slug} />
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import { useDashboardRouter } from "@/lib/DashboardRouter";
import { cn } from "@/lib/utils";
import { LazyCreateProjectDialog } from "components/settings/ApiKeys/Create/LazyCreateAPIKeyDialog";
import { formatDate } from "date-fns";
import { useTrack } from "hooks/analytics/useTrack";
import { PlusIcon, SearchIcon, UserPlus } from "lucide-react";
import { PlusIcon, SearchIcon } from "lucide-react";
import Link from "next/link";
import { useMemo, useState } from "react";
import type { ThirdwebClient } from "thirdweb";
Expand Down Expand Up @@ -120,9 +119,6 @@ export function TeamProjectsPage(props: {
createProject={() => setIsCreateProjectDialogOpen(true)}
teamMembersSettingsPath={`/team/${props.team.slug}/~/settings/members`}
/>
<Link href={`/team/${props.team.slug}/~/settings/members`}>
<ShareButton />
</Link>
</div>
</div>
</div>
Expand Down Expand Up @@ -283,29 +279,6 @@ function AddNewButton(props: {
);
}

function ShareButton() {
//track event click
const trackEvent = useTrack();
return (
<Button
variant="default"
className="absolute top-0 right-0 gap-2 lg:static"
onClick={() =>
trackEvent({
category: "inviteTeam",
action: "click",
label: "invite-team",
})
}
>
<UserPlus className="size-4" />
<span>
<span className="hidden lg:inline">Invite</span>to Team
</span>
</Button>
);
}

function SelectBy(props: {
value: SortById;
onChange: (value: SortById) => void;
Expand Down
Loading