Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statistics: fix wrapping issues #118

Merged
merged 3 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/DeviceStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ const DeviceStatistics: VoidComponent<DeviceStatisticsProps> = (props) => {
const allTime = () => statistics()?.all

return (
<div class={clsx('flex h-10 w-full gap-8', props.class)}>
<div class="flex flex-col justify-between">
<div class={clsx('flex h-10 w-full', props.class)}>
<div class="flex grow flex-col justify-between">
<span class="text-body-sm text-on-surface-variant">Distance</span>
<span class="font-mono text-label-lg uppercase">{formatDistance(allTime()?.distance)}</span>
</div>

<div class="flex flex-col justify-between">
<div class="flex grow flex-col justify-between">
<span class="text-body-sm text-on-surface-variant">Duration</span>
<span class="font-mono text-label-lg uppercase">{formatDuration(allTime()?.minutes)}</span>
</div>

<div class="flex flex-col justify-between">
<div class="flex grow flex-col justify-between">
<span class="text-body-sm text-on-surface-variant">Routes</span>
<span class="font-mono text-label-lg uppercase">{allTime()?.routes ?? 0}</span>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/RouteStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ const RouteStatistics: VoidComponent<RouteStatisticsProps> = (props) => {

return (
<div class={clsx('flex size-full items-stretch gap-8', props.class)}>
<div class="flex flex-col justify-between">
<div class="flex grow flex-col justify-between">
<span class="text-body-sm text-on-surface-variant">Distance</span>
<span class="font-mono text-label-lg uppercase">{formatRouteDistance(props.route)}</span>
</div>

<div class="flex flex-col justify-between">
<div class="flex grow flex-col justify-between">
<span class="text-body-sm text-on-surface-variant">Duration</span>
<span class="font-mono text-label-lg uppercase">{formatRouteDuration(props.route)}</span>
</div>

<div class="flex flex-col justify-between">
<div class="hidden grow flex-col justify-between xs:flex">
<span class="text-body-sm text-on-surface-variant">Engaged</span>
<Suspense>
<span class="font-mono text-label-lg uppercase">{formatEngagement(timeline())}</span>
</Suspense>
</div>

<div class="flex flex-col justify-between">
<div class="flex grow flex-col justify-between">
<span class="text-body-sm text-on-surface-variant">User flags</span>
<Suspense>
<span class="font-mono text-label-lg uppercase">{formatUserFlags(timeline())}</span>
Expand Down
14 changes: 5 additions & 9 deletions src/pages/dashboard/activities/DeviceActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,11 @@ const DeviceActivity: VoidComponent<DeviceActivityProps> = (props) => {
</TopAppBar>
<div class="flex flex-col gap-4 px-4 pb-4">
<div class="h-min overflow-hidden rounded-lg bg-surface-container-low">
<div class="flex">
<div class="flex-auto">
<Suspense fallback={<div class="skeleton-loader size-full" />}>
<div class="p-4">
<DeviceStatistics dongleId={props.dongleId} />
</div>
</Suspense>
</div>
<div class="flex p-4">
<div class="m-4 flex">
<Suspense fallback={<div class="skeleton-loader size-full" />}>
<DeviceStatistics dongleId={props.dongleId} />
</Suspense>
<div class="flex items-center">
<IconButton onClick={() => void takeSnapshot()}>camera</IconButton>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ export default {
},
},
screens: {
xs: '425px',
// Larger screen phones (iPhone Pro/Max, Galaxy Ultra, Pixel XL/Pro...)
xs: '411px',
},
animation: {
indeterminate1: 'indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite',
Expand Down
Loading