Update ContributionCalendar to adjust weeks displayed based on mobile view
- Modified the logic for determining the number of weeks to show in the ContributionCalendar component, reducing the count from 20 to 19 when in mobile view and not expanded. - This change aims to optimize the calendar display for better usability on smaller screens.
This commit is contained in:
@@ -97,7 +97,7 @@ export default function ContributionCalendar({ data }) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Determine how many weeks to show
|
// Determine how many weeks to show
|
||||||
const weeksToShow = isMobile && !expanded ? 20 : 52;
|
const weeksToShow = isMobile && !expanded ? 19 : 52;
|
||||||
const startWeek = 52 - weeksToShow;
|
const startWeek = 52 - weeksToShow;
|
||||||
const visibleDays = days.slice(startWeek * 7, 52 * 7);
|
const visibleDays = days.slice(startWeek * 7, 52 * 7);
|
||||||
const visibleMonthLabels = monthLabels.filter(l => l.week >= startWeek);
|
const visibleMonthLabels = monthLabels.filter(l => l.week >= startWeek);
|
||||||
|
Reference in New Issue
Block a user