From 83822c777c7d6f754c2fdf1441dbff13e355de66 Mon Sep 17 00:00:00 2001 From: Heath Daniel Date: Tue, 27 Apr 2021 21:50:54 -0400 Subject: [PATCH 1/2] Fix calendar layout and adjust spacing --- pages/[user]/[type].tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsx index 1b9392e7..f49ffd64 100644 --- a/pages/[user]/[type].tsx +++ b/pages/[user]/[type].tsx @@ -67,11 +67,21 @@ export default function Type(props) { days.push(i); } - const calendar = days.map((day) => + + // Create placeholder elements for empty days in first week + const weekdayOfFirst = dayjs().month(selectedMonth).date(1).day(); + const emptyDays = Array(weekdayOfFirst).fill(null).map((day, i) => ( +
+ {null} +
+ )); + + // Combine placeholder days with actual days + const calendar = [...emptyDays, ...days.map((day) => - ); + )]; // Handle date change useEffect(async () => { @@ -132,7 +142,7 @@ export default function Type(props) {
-
+
{props.user.avatar && Avatar}

{props.user.name}

From 36db7fb4f1bd114e6775a08aea401af895ae2aff Mon Sep 17 00:00:00 2001 From: Heath Daniel Date: Tue, 27 Apr 2021 21:56:30 -0400 Subject: [PATCH 2/2] Match formatting --- pages/[user]/[type].tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsx index f49ffd64..29a66fe6 100644 --- a/pages/[user]/[type].tsx +++ b/pages/[user]/[type].tsx @@ -70,16 +70,16 @@ export default function Type(props) { // Create placeholder elements for empty days in first week const weekdayOfFirst = dayjs().month(selectedMonth).date(1).day(); - const emptyDays = Array(weekdayOfFirst).fill(null).map((day, i) => ( -
- {null} -
- )); + const emptyDays = Array(weekdayOfFirst).fill(null).map((day, i) => +
+ {null} +
+ ); // Combine placeholder days with actual days const calendar = [...emptyDays, ...days.map((day) => )];