mobile: fix months ordering bug in wrapped

This commit is contained in:
Ammar Ahmed
2025-12-17 09:01:58 +05:00
parent 2dafde0117
commit adc7bb1d9e

View File

@@ -590,6 +590,21 @@ function AttachmentsSlide({
);
}
const MONTHS_IN_ORDER = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
// Summary Slide
function SummarySlide({
stats,
@@ -653,7 +668,7 @@ function SummarySlide({
gap: 10
}}
>
{Object.keys(stats.monthlyStats).map((item) => (
{MONTHS_IN_ORDER.map((item) => (
<View
key={item}
style={{
@@ -663,7 +678,10 @@ function SummarySlide({
>
<View
style={{
backgroundColor: colors.primary.accent,
backgroundColor:
stats.monthlyStats[item] === maxCount
? colors.primary.accent
: colors.primary.icon,
height:
maxCount > 0
? (stats.monthlyStats[item] / maxCount) * 100