mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 20:39:44 +01:00
Updated team and websites tables.
This commit is contained in:
parent
1a9501d8ce
commit
36f207c97d
@ -5,7 +5,15 @@ import Icons from 'components/icons';
|
|||||||
import { ROLES } from 'lib/constants';
|
import { ROLES } from 'lib/constants';
|
||||||
import LinkButton from 'components/common/LinkButton';
|
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 { formatMessage, labels } = useMessages();
|
||||||
const { user } = useLogin();
|
const { user } = useLogin();
|
||||||
const breakpoint = useBreakpoint();
|
const breakpoint = useBreakpoint();
|
||||||
@ -29,9 +37,10 @@ export function TeamsTable({ data = [] }: { data: any[] }) {
|
|||||||
const isOwner = user.id === owner?.userId;
|
const isOwner = user.id === owner?.userId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
showActions && (
|
||||||
<>
|
<>
|
||||||
{isOwner && (
|
{allowEdit && isOwner && (
|
||||||
<LinkButton href={`/settings/teams/${id}`}>
|
<LinkButton href={`/teams/${id}/settings`}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Edit />
|
<Icons.Edit />
|
||||||
</Icon>
|
</Icon>
|
||||||
@ -45,6 +54,7 @@ export function TeamsTable({ data = [] }: { data: any[] }) {
|
|||||||
<Text>{formatMessage(labels.switch)}</Text>
|
<Text>{formatMessage(labels.switch)}</Text>
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
</>
|
</>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</GridColumn>
|
</GridColumn>
|
||||||
|
@ -46,7 +46,7 @@ export function WebsitesTable({
|
|||||||
</LinkButton>
|
</LinkButton>
|
||||||
)}
|
)}
|
||||||
{allowView && (
|
{allowView && (
|
||||||
<LinkButton href={renderTeamUrl(renderTeamUrl(`/websites/${websiteId}`))}>
|
<LinkButton href={renderTeamUrl(`/websites/${websiteId}`)}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.ArrowRight />
|
<Icons.ArrowRight />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
Loading…
Reference in New Issue
Block a user