mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Added card mode to DataTable.
This commit is contained in:
parent
5f73e4e8db
commit
a15fb89c90
8 changed files with 22 additions and 64 deletions
|
|
@ -6,6 +6,7 @@ import useApi from 'components/hooks/useApi';
|
|||
import DataTable from 'components/common/DataTable';
|
||||
import useFilterQuery from 'components/hooks/useFilterQuery';
|
||||
import useCache from 'store/cache';
|
||||
import { useBreakpoint } from 'react-basics';
|
||||
|
||||
export interface WebsitesDataTableProps {
|
||||
allowEdit?: boolean;
|
||||
|
|
@ -45,6 +46,7 @@ export function WebsitesDataTable({
|
|||
children,
|
||||
}: WebsitesDataTableProps) {
|
||||
const queryResult = useWebsites({ includeTeams, onlyTeams });
|
||||
const breakpoint = useBreakpoint();
|
||||
|
||||
return (
|
||||
<DataTable queryResult={queryResult}>
|
||||
|
|
@ -55,6 +57,7 @@ export function WebsitesDataTable({
|
|||
showActions={showActions}
|
||||
allowEdit={allowEdit}
|
||||
allowView={allowView}
|
||||
cardMode={['xs', 'sm', 'md'].includes(breakpoint)}
|
||||
>
|
||||
{children}
|
||||
</WebsitesTable>
|
||||
|
|
|
|||
|
|
@ -9,13 +9,14 @@ export function WebsitesTable({
|
|||
showActions,
|
||||
allowEdit,
|
||||
allowView,
|
||||
cardMode,
|
||||
children,
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useUser();
|
||||
|
||||
return (
|
||||
<GridTable data={data}>
|
||||
<GridTable data={data} cardMode={cardMode}>
|
||||
<GridColumn name="name" label={formatMessage(labels.name)} />
|
||||
<GridColumn name="domain" label={formatMessage(labels.domain)} />
|
||||
{showTeam && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue