mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
Hide edit button cloudMode.
This commit is contained in:
parent
530fc5dcd1
commit
d3e175a31d
@ -9,7 +9,14 @@ import useUser from 'hooks/useUser';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { Button, Icon, Icons, Modal, ModalTrigger, Text, useToasts } from 'react-basics';
|
||||
|
||||
export function WebsitesList({ showTeam, showHeader = true, includeTeams, onlyTeams, fetch }) {
|
||||
export function WebsitesList({
|
||||
showTeam,
|
||||
showEditButton = true,
|
||||
showHeader = true,
|
||||
includeTeams,
|
||||
onlyTeams,
|
||||
fetch,
|
||||
}) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { user } = useUser();
|
||||
|
||||
@ -59,6 +66,7 @@ export function WebsitesList({ showTeam, showHeader = true, includeTeams, onlyTe
|
||||
<WebsitesTable
|
||||
data={data}
|
||||
showTeam={showTeam}
|
||||
showEditButton={showEditButton}
|
||||
onFilterChange={handleFilterChange}
|
||||
onPageChange={handlePageChange}
|
||||
onPageSizeChange={handlePageSizeChange}
|
||||
|
@ -13,6 +13,7 @@ export function WebsitesTable({
|
||||
onPageChange,
|
||||
onPageSizeChange,
|
||||
showTeam,
|
||||
showEditButton,
|
||||
}) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { openExternal } = useConfig();
|
||||
@ -58,7 +59,7 @@ export function WebsitesTable({
|
||||
|
||||
return (
|
||||
<>
|
||||
{(!showTeam || ownerId === user.id) && (
|
||||
{showEditButton && (!showTeam || ownerId === user.id) && (
|
||||
<Link href={`/settings/websites/${id}`}>
|
||||
<Button>
|
||||
<Icon>
|
||||
|
@ -58,9 +58,17 @@ export function WebsitesPage() {
|
||||
<Item key="team-webaites">{formatMessage(labels.teamWebsites)}</Item>
|
||||
</Tabs>
|
||||
|
||||
{tab === 'my-websites' && <WebsiteList showHeader={false} fetch={fetch} />}
|
||||
{tab === 'my-websites' && (
|
||||
<WebsiteList showEditButton={!cloudMode} showHeader={false} fetch={fetch} />
|
||||
)}
|
||||
{tab === 'team-webaites' && (
|
||||
<WebsiteList showHeader={false} fetch={fetch} showTeam={true} onlyTeams={true} />
|
||||
<WebsiteList
|
||||
showEditButton={!cloudMode}
|
||||
showHeader={false}
|
||||
fetch={fetch}
|
||||
showTeam={true}
|
||||
onlyTeams={true}
|
||||
/>
|
||||
)}
|
||||
</Page>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user