Skip to content
TypeScript

fix(mobile): usage chart legend wraps instead of pushing the end date off-screen (#18203)

Bartłomiej Czyżewski2b16747a92b1
diff --git a/apps/mobile/src/features/usage/UsageRouteScreen.tsx b/apps/mobile/src/features/usage/UsageRouteScreen.tsx
index 36d00a73c47..2b8913c9263 100644
--- a/apps/mobile/src/features/usage/UsageRouteScreen.tsx
+++ b/apps/mobile/src/features/usage/UsageRouteScreen.tsx
@@ -546,13 +546,20 @@ function ChartCard(props: {
</View>
)}
- <View className="flex-row items-center justify-between">
- <Text className="text-xs text-foreground-tertiary">
- {props.isPast24Hours
- ? formatHourShort(props.days[0] ?? "", props.timeZone)
- : formatDayShort(props.sinceDay)}
- </Text>
- <View className="flex-row items-center gap-4">
+ <View className="gap-2">
+ <View className="flex-row items-center justify-between">
+ <Text className="text-xs text-foreground-tertiary">
+ {props.isPast24Hours
+ ? formatHourShort(props.days[0] ?? "", props.timeZone)
+ : formatDayShort(props.sinceDay)}
+ </Text>
+ <Text className="text-xs text-foreground-tertiary">
+ {props.isPast24Hours
+ ? formatHourShort(props.days[props.days.length - 1] ?? "", props.timeZone)
+ : formatDayShort(props.untilDay)}
+ </Text>
+ </View>
+ <View className="flex-row flex-wrap items-center gap-x-4 gap-y-1">
{merged.providers.map((provider) => (
<View key={provider.provider} className="flex-row items-center gap-1.5">
<View
@@ -565,11 +572,6 @@ function ChartCard(props: {
</View>
))}
</View>
- <Text className="text-xs text-foreground-tertiary">
- {props.isPast24Hours
- ? formatHourShort(props.days[props.days.length - 1] ?? "", props.timeZone)
- : formatDayShort(props.untilDay)}
- </Text>
</View>
</View>
);