Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Updated team and websites tables.

Mike Cao36f207c97d5b
diff --git a/src/app/(main)/settings/teams/TeamsTable.tsx b/src/app/(main)/settings/teams/TeamsTable.tsx
index e35d0412c..3ee0ecc34 100644
--- a/src/app/(main)/settings/teams/TeamsTable.tsx
+++ b/src/app/(main)/settings/teams/TeamsTable.tsx
@@ -5,7 +5,15 @@ import Icons from 'components/icons';
import { ROLES } from 'lib/constants';
import LinkButton from 'components/common/LinkButton';
-export function TeamsTable({ data = [] }: { data: any[] }) {
+export function TeamsTable({
+ data = [],
+ allowEdit = true,
+ showActions = true,
+}: {
+ data: any[];
+ allowEdit?: boolean;
+ showActions?: boolean;
+}) {
const { formatMessage, labels } = useMessages();
const { user } = useLogin();
const breakpoint = useBreakpoint();
@@ -29,22 +37,24 @@ export function TeamsTable({ data = [] }: { data: any[] }) {
const isOwner = user.id === owner?.userId;
return (
- <>
- {isOwner && (
- <LinkButton href={`/settings/teams/${id}`}>
+ showActions && (
+ <>
+ {allowEdit && isOwner && (
+ <LinkButton href={`/teams/${id}/settings`}>
+ <Icon>
+ <Icons.Edit />
+ </Icon>
+ <Text>{formatMessage(labels.edit)}</Text>
+ </LinkButton>
+ )}
+ <LinkButton href={`/teams/${id}`}>
<Icon>
- <Icons.Edit />
+ <Icons.Change />
</Icon>
- <Text>{formatMessage(labels.edit)}</Text>
+ <Text>{formatMessage(labels.switch)}</Text>
</LinkButton>
- )}
- <LinkButton href={`/teams/${id}`}>
- <Icon>
- <Icons.Change />
- </Icon>
- <Text>{formatMessage(labels.switch)}</Text>
- </LinkButton>
- </>
+ </>
+ )
);
}}
</GridColumn>
diff --git a/src/app/(main)/settings/websites/WebsitesTable.tsx b/src/app/(main)/settings/websites/WebsitesTable.tsx
index 6486babe3..8460b14d0 100644
--- a/src/app/(main)/settings/websites/WebsitesTable.tsx
+++ b/src/app/(main)/settings/websites/WebsitesTable.tsx
@@ -46,7 +46,7 @@ export function WebsitesTable({
</LinkButton>
)}
{allowView && (
- <LinkButton href={renderTeamUrl(renderTeamUrl(`/websites/${websiteId}`))}>
+ <LinkButton href={renderTeamUrl(`/websites/${websiteId}`)}>
<Icon>
<Icons.ArrowRight />
</Icon>