mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 12:29:35 +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,22 +37,24 @@ export function TeamsTable({ data = [] }: { data: any[] }) {
|
|||||||
const isOwner = user.id === owner?.userId;
|
const isOwner = user.id === owner?.userId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
showActions && (
|
||||||
{isOwner && (
|
<>
|
||||||
<LinkButton href={`/settings/teams/${id}`}>
|
{allowEdit && isOwner && (
|
||||||
|
<LinkButton href={`/teams/${id}/settings`}>
|
||||||
|
<Icon>
|
||||||
|
<Icons.Edit />
|
||||||
|
</Icon>
|
||||||
|
<Text>{formatMessage(labels.edit)}</Text>
|
||||||
|
</LinkButton>
|
||||||
|
)}
|
||||||
|
<LinkButton href={`/teams/${id}`}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Edit />
|
<Icons.Change />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>{formatMessage(labels.edit)}</Text>
|
<Text>{formatMessage(labels.switch)}</Text>
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
)}
|
</>
|
||||||
<LinkButton href={`/teams/${id}`}>
|
)
|
||||||
<Icon>
|
|
||||||
<Icons.Change />
|
|
||||||
</Icon>
|
|
||||||
<Text>{formatMessage(labels.switch)}</Text>
|
|
||||||
</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