Cap analytics timeframe label
This commit is contained in:
@@ -2883,6 +2883,7 @@
|
||||
"kpiLikes": "Likes",
|
||||
"activityTitle": "Aktivitäts-Zeitachse",
|
||||
"timeframe": "Letzte {{hours}} Stunden",
|
||||
"timeframeHint": "Ältere Aktivität ausgeblendet",
|
||||
"uploadsPerHour": "Uploads pro Stunde",
|
||||
"noActivity": "Noch keine Uploads",
|
||||
"emptyActionShareQr": "QR-Code teilen",
|
||||
|
||||
@@ -2887,6 +2887,7 @@
|
||||
"kpiLikes": "Likes",
|
||||
"activityTitle": "Activity Timeline",
|
||||
"timeframe": "Last {{hours}} hours",
|
||||
"timeframeHint": "Older activity hidden",
|
||||
"uploadsPerHour": "Uploads per hour",
|
||||
"noActivity": "No uploads yet",
|
||||
"emptyActionShareQr": "Share your QR code",
|
||||
|
||||
@@ -98,7 +98,10 @@ export default function MobileEventAnalyticsPage() {
|
||||
const hasTimeline = timeline.length > 0;
|
||||
const hasContributors = contributors.length > 0;
|
||||
const hasTasks = tasks.length > 0;
|
||||
const timeframeHours = resolveTimelineHours(timeline.map((point) => point.timestamp), 12);
|
||||
const fallbackHours = 12;
|
||||
const rawTimelineHours = resolveTimelineHours(timeline.map((point) => point.timestamp), fallbackHours);
|
||||
const timeframeHours = Math.min(rawTimelineHours, fallbackHours);
|
||||
const isTimeframeCapped = rawTimelineHours > fallbackHours;
|
||||
|
||||
// Prepare chart data
|
||||
const maxTimelineCount = resolveMaxCount(timeline.map((point) => point.count));
|
||||
@@ -144,9 +147,16 @@ export default function MobileEventAnalyticsPage() {
|
||||
{t('analytics.activityTitle', 'Activity Timeline')}
|
||||
</Text>
|
||||
</XStack>
|
||||
<Text fontSize="$xs" color={muted}>
|
||||
{t('analytics.timeframe', 'Last {{hours}} hours', { hours: timeframeHours })}
|
||||
</Text>
|
||||
<YStack space="$0.5">
|
||||
<Text fontSize="$xs" color={muted}>
|
||||
{t('analytics.timeframe', 'Last {{hours}} hours', { hours: timeframeHours })}
|
||||
</Text>
|
||||
{isTimeframeCapped ? (
|
||||
<Text fontSize="$xs" color={muted}>
|
||||
{t('analytics.timeframeHint', 'Older activity hidden')}
|
||||
</Text>
|
||||
) : null}
|
||||
</YStack>
|
||||
|
||||
{hasTimeline ? (
|
||||
<YStack height={180} justifyContent="flex-end" space="$2">
|
||||
|
||||
Reference in New Issue
Block a user