mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 12:29:35 +01:00
Update show edit button logic for websites table.
This commit is contained in:
parent
926effb0e3
commit
d818bf5aaf
@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import { Text, Icon, Icons, GridTable, GridColumn, useBreakpoint } from 'react-basics';
|
import { Text, Icon, Icons, GridTable, GridColumn, useBreakpoint } from 'react-basics';
|
||||||
import { useMessages, useLogin, useTeamUrl } from 'components/hooks';
|
import { useMessages, useTeamUrl } from 'components/hooks';
|
||||||
import LinkButton from 'components/common/LinkButton';
|
import LinkButton from 'components/common/LinkButton';
|
||||||
|
|
||||||
export interface WebsitesTableProps {
|
export interface WebsitesTableProps {
|
||||||
@ -18,11 +18,9 @@ export function WebsitesTable({
|
|||||||
showActions,
|
showActions,
|
||||||
allowEdit,
|
allowEdit,
|
||||||
allowView,
|
allowView,
|
||||||
teamId,
|
|
||||||
children,
|
children,
|
||||||
}: WebsitesTableProps) {
|
}: WebsitesTableProps) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { user } = useLogin();
|
|
||||||
const breakpoint = useBreakpoint();
|
const breakpoint = useBreakpoint();
|
||||||
const { renderTeamUrl } = useTeamUrl();
|
const { renderTeamUrl } = useTeamUrl();
|
||||||
|
|
||||||
@ -37,7 +35,7 @@ export function WebsitesTable({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{allowEdit && (teamId || user.isAdmin) && (
|
{allowEdit && (
|
||||||
<LinkButton href={renderTeamUrl(`/settings/websites/${websiteId}`)}>
|
<LinkButton href={renderTeamUrl(`/settings/websites/${websiteId}`)}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Edit />
|
<Icons.Edit />
|
||||||
|
Loading…
Reference in New Issue
Block a user