From c9ef169989cf4daa2049971033ca591c18ffd7ce Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Sat, 27 Dec 2025 22:01:41 -0500 Subject: [PATCH] Refactor Calendar and Home components for improved navigation and user experience Updated the Calendar component's route from "/event-calendar" to "/calendar" for clarity. Enhanced the Home component to provide dynamic content based on the presence of students and teams, introducing new sections for "Getting Started" and "Team Building". Improved the DashboardCard component to support emphasized styling for better visual hierarchy. Updated the navigation menu to reflect these changes and ensure a more intuitive user experience. --- .../Components/Features/Calendar/Index.razor | 2 +- WebApp/Components/Pages/Home.razor | 187 +++++++++++++----- .../Shared/Components/DashboardCard.razor | 8 +- WebApp/Components/Shared/Layout/NavMenu.razor | 24 ++- 4 files changed, 167 insertions(+), 54 deletions(-) diff --git a/WebApp/Components/Features/Calendar/Index.razor b/WebApp/Components/Features/Calendar/Index.razor index ae44787..6ffac55 100644 --- a/WebApp/Components/Features/Calendar/Index.razor +++ b/WebApp/Components/Features/Calendar/Index.razor @@ -1,4 +1,4 @@ -@page "/event-calendar" +@page "/calendar" @attribute [Authorize] @using WebApp.Components.Shared.Components @using WebApp.Models diff --git a/WebApp/Components/Pages/Home.razor b/WebApp/Components/Pages/Home.razor index a92424a..5117fc4 100644 --- a/WebApp/Components/Pages/Home.razor +++ b/WebApp/Components/Pages/Home.razor @@ -26,57 +26,153 @@ - -Data - - - - - - - - @if (!string.IsNullOrEmpty(_gradeDistribution) && _gradeDistribution != "No students yet") - { - - @((MarkupString)_gradeDistribution) - - } - else - { - No students yet - } - - - - - - - Tools - - +@if (!_hasStudents) +{ + + + Getting Started + Add your chapter's students to begin + + + Import or add your chapter roster + - + + +} +else if (!_hasTeams) +{ + + + Team Building + Collect event rankings and build your teams + + + + + + + + + Chapter Data + + + + @if (!string.IsNullOrEmpty(_gradeDistribution) && _gradeDistribution != "No students yet") + { + + @((MarkupString)_gradeDistribution) + + } + + + + +} +else +{ + + + Scheduling + + + + + + Teams & Registration + + + + + + + + + Team Building + + + + + + + + + Chapter Data + + + + @if (!string.IsNullOrEmpty(_gradeDistribution) && _gradeDistribution != "No students yet") + { + + @((MarkupString)_gradeDistribution) + + } + + + + +} + @code { private int _eventCount; private int _individualEventsCount; @@ -87,6 +183,9 @@ private int _individualTeamsCount; private int _groupTeamsCount; + private bool _hasStudents => _studentCount > 0; + private bool _hasTeams => _teamCount > 0; + protected override async Task OnInitializedAsync() { await LoadStatistics(); diff --git a/WebApp/Components/Shared/Components/DashboardCard.razor b/WebApp/Components/Shared/Components/DashboardCard.razor index 542d5c2..8a8ac4e 100644 --- a/WebApp/Components/Shared/Components/DashboardCard.razor +++ b/WebApp/Components/Shared/Components/DashboardCard.razor @@ -1,7 +1,7 @@ @using Microsoft.AspNetCore.Components - +
@@ -33,8 +33,14 @@ [Parameter] public string? Caption { get; set; } [Parameter] public RenderFragment? ChildContent { get; set; } [Parameter] public string NavigateUrl { get; set; } = string.Empty; + [Parameter] public bool Emphasized { get; set; } [Inject] private NavigationManager Navigation { get; set; } = default!; + private string CardClass => Emphasized ? "pa-4 emphasized-card" : "pa-4"; + private string CardStyle => Emphasized + ? "cursor: pointer; height: 100%; border: 2px solid var(--mud-palette-primary);" + : "cursor: pointer; height: 100%;"; + private void HandleClick() { if (!string.IsNullOrEmpty(NavigateUrl)) diff --git a/WebApp/Components/Shared/Layout/NavMenu.razor b/WebApp/Components/Shared/Layout/NavMenu.razor index c4451b2..db6a2c1 100644 --- a/WebApp/Components/Shared/Layout/NavMenu.razor +++ b/WebApp/Components/Shared/Layout/NavMenu.razor @@ -7,25 +7,33 @@ TSA Chapter Organizer @Configuration["ChapterSettings:Name"] - Events - Students - - Teams + + Meeting Schedule + Event Calendar + + + Registration + Teams Print out Handout - Schedule - Event Calendar - + + Event Ranking Team Assignment + + + Students + Events + + Chapter Settings - Validation Settings + Validation Settings