From 743e7c0477491245571268466111a1b41417803b Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Sun, 13 Aug 2023 22:37:04 -0700 Subject: [PATCH] Update show website state. --- .../pages/settings/websites/WebsitesTable.js | 22 +++++++++++-------- queries/admin/website.ts | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/components/pages/settings/websites/WebsitesTable.js b/components/pages/settings/websites/WebsitesTable.js index 614b33418..dec1b3233 100644 --- a/components/pages/settings/websites/WebsitesTable.js +++ b/components/pages/settings/websites/WebsitesTable.js @@ -3,6 +3,7 @@ import { Button, Text, Icon, Icons } from 'react-basics'; import SettingsTable from 'components/common/SettingsTable'; import useMessages from 'hooks/useMessages'; import useConfig from 'hooks/useConfig'; +import useUser from 'hooks/useUser'; export function WebsitesTable({ data = [], @@ -14,6 +15,7 @@ export function WebsitesTable({ }) { const { formatMessage, labels } = useMessages(); const { openExternal } = useConfig(); + const { user } = useUser(); const teamColumns = [ { name: 'teamName', label: formatMessage(labels.teamName) }, @@ -42,7 +44,7 @@ export function WebsitesTable({ const { id, teamWebsite, - user: { username }, + user: { username, id: ownerId }, } = row; if (showTeam) { row.teamName = teamWebsite[0]?.team.name; @@ -51,14 +53,16 @@ export function WebsitesTable({ return ( <> - - - + {(!showTeam || ownerId === user.id) && ( + + + + )}