Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

add improved truncation between tablets and phones

Francis Cao6eefb4173cf2
diff --git a/src/components/hooks/useMobile.ts b/src/components/hooks/useMobile.ts
index e3afc5ee6..6b40f3da1 100644
--- a/src/components/hooks/useMobile.ts
+++ b/src/components/hooks/useMobile.ts
@@ -3,6 +3,7 @@ import { useBreakpoint } from '@umami/react-zen';
export function useMobile() {
const breakpoint = useBreakpoint();
const isMobile = ['xs', 'sm', 'md'].includes(breakpoint);
+ const isPhone = ['xs', 'sm'].includes(breakpoint);
- return { breakpoint, isMobile };
+ return { breakpoint, isMobile, isPhone };
}
diff --git a/src/components/metrics/ListTable.tsx b/src/components/metrics/ListTable.tsx
index 3aef2b287..303556b01 100644
--- a/src/components/metrics/ListTable.tsx
+++ b/src/components/metrics/ListTable.tsx
@@ -42,7 +42,7 @@ export function ListTable({
currency,
}: ListTableProps) {
const { formatMessage, labels } = useMessages();
- const { isMobile } = useMobile();
+ const { isPhone } = useMobile();
const getRow = (row: ListData, index: number) => {
const { label, count, percent } = row;
@@ -57,7 +57,7 @@ export function ListTable({
showPercentage={showPercentage}
change={renderChange ? renderChange(row, index) : null}
currency={currency}
- isMobile={isMobile}
+ isMobile={isPhone}
/>
);
};