mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Updated query hooks for teams and websites.
This commit is contained in:
parent
9448aa3ab5
commit
2fa50892d8
61 changed files with 508 additions and 539 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { ReactNode } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Button, Text, Icon, Icons, GridTable, GridColumn, useBreakpoint } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { useUser } from 'components/hooks';
|
||||
import { useMessages, useLogin } from 'components/hooks';
|
||||
|
||||
export interface WebsitesTableProps {
|
||||
data: any[];
|
||||
|
|
@ -22,7 +21,7 @@ export function WebsitesTable({
|
|||
children,
|
||||
}: WebsitesTableProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useUser();
|
||||
const { user } = useLogin();
|
||||
const breakpoint = useBreakpoint();
|
||||
|
||||
return (
|
||||
|
|
@ -32,13 +31,12 @@ export function WebsitesTable({
|
|||
{showActions && (
|
||||
<GridColumn name="action" label=" " alignment="end">
|
||||
{row => {
|
||||
const { id } = row;
|
||||
const isOwner = row.userId === user.id || row.teamId === teamId;
|
||||
const { id, userId } = row;
|
||||
|
||||
return (
|
||||
<>
|
||||
{allowEdit && isOwner && (
|
||||
<Link href={`/settings/${id}`}>
|
||||
{allowEdit && !teamId && user.id === userId && (
|
||||
<Link href={`/settings/websites/${id}`}>
|
||||
<Button>
|
||||
<Icon>
|
||||
<Icons.Edit />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue