mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +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 && (
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
.body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
|
@ -31,6 +32,11 @@
|
|||
min-width: min-content;
|
||||
}
|
||||
|
||||
.body > div > div > div {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.pager {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useTransition, animated } from 'react-spring';
|
||||
import { useTransition, animated } from '@react-spring/web';
|
||||
import { Button, Icon } from 'react-basics';
|
||||
import useTheme from 'components/hooks/useTheme';
|
||||
import Icons from 'components/icons';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import useMeasure from 'react-use-measure';
|
||||
import { FixedSizeList } from 'react-window';
|
||||
import { useSpring, animated, config } from 'react-spring';
|
||||
import { useSpring, animated, config } from '@react-spring/web';
|
||||
import classNames from 'classnames';
|
||||
import Empty from 'components/common/Empty';
|
||||
import { formatLongNumber } from 'lib/format';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import classNames from 'classnames';
|
||||
import { useSpring, animated } from 'react-spring';
|
||||
import { useSpring, animated } from '@react-spring/web';
|
||||
import { formatNumber } from 'lib/format';
|
||||
import styles from './MetricCard.module.css';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue