diff --git a/components/pages/reports/ReportsPage.js b/components/pages/reports/ReportsPage.js index 8fc56917..29c77975 100644 --- a/components/pages/reports/ReportsPage.js +++ b/components/pages/reports/ReportsPage.js @@ -3,11 +3,13 @@ import Page from 'components/layout/Page'; import PageHeader from 'components/layout/PageHeader'; import { useMessages, useReports } from 'hooks'; import Link from 'next/link'; +import useConfig from 'hooks/useConfig'; import { Button, Icon, Icons, Text } from 'react-basics'; import ReportsTable from './ReportsTable'; export function ReportsPage() { const { formatMessage, labels, messages } = useMessages(); + const { cloudMode } = useConfig(); const { reports, error, @@ -21,21 +23,19 @@ export function ReportsPage() { const hasData = (reports && reports?.data.length !== 0) || filter; - const handleDelete = async id => { - await deleteReport(id); - }; - return ( - - - + {!cloudMode && ( + + + + )} {hasData && ( diff --git a/components/pages/settings/websites/WebsitesList.js b/components/pages/settings/websites/WebsitesList.js index 799b032b..538fc61a 100644 --- a/components/pages/settings/websites/WebsitesList.js +++ b/components/pages/settings/websites/WebsitesList.js @@ -1,18 +1,18 @@ -import { Button, Icon, Text, Modal, ModalTrigger, useToasts, Icons } from 'react-basics'; import Page from 'components/layout/Page'; import PageHeader from 'components/layout/PageHeader'; -import EmptyPlaceholder from 'components/common/EmptyPlaceholder'; import WebsiteAddForm from 'components/pages/settings/websites/WebsiteAddForm'; import WebsitesTable from 'components/pages/settings/websites/WebsitesTable'; import useApi from 'hooks/useApi'; -import useUser from 'hooks/useUser'; -import useMessages from 'hooks/useMessages'; -import { ROLES } from 'lib/constants'; import useApiFilter from 'hooks/useApiFilter'; +import useMessages from 'hooks/useMessages'; +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 }) { const { formatMessage, labels, messages } = useMessages(); const { user } = useUser(); + const { filter, page, pageSize, handleFilterChange, handlePageChange, handlePageSizeChange } = useApiFilter(); const { get, useQuery } = useApi(); diff --git a/components/pages/websites/WebsitesPage.js b/components/pages/websites/WebsitesPage.js index 4fdd025d..4a2207da 100644 --- a/components/pages/websites/WebsitesPage.js +++ b/components/pages/websites/WebsitesPage.js @@ -4,6 +4,7 @@ import WebsiteAddForm from 'components/pages/settings/websites/WebsiteAddForm'; import WebsiteList from 'components/pages/settings/websites/WebsitesList'; import { useMessages } from 'hooks'; import useUser from 'hooks/useUser'; +import useConfig from 'hooks/useConfig'; import { ROLES } from 'lib/constants'; import { useState } from 'react'; import { @@ -23,6 +24,7 @@ export function WebsitesPage() { const [tab, setTab] = useState('my-websites'); const [fetch, setFetch] = useState(1); const { user } = useUser(); + const { cloudMode } = useConfig(); const { showToast } = useToasts(); const handleSave = async () => { @@ -50,7 +52,7 @@ export function WebsitesPage() { return ( - {addButton} + {!cloudMode && addButton} {formatMessage(labels.myWebsites)} {formatMessage(labels.teamWebsites)}