Refactor chip variants in event and team components for consistency
This commit updates various components within the Events and MeetingSchedule features to utilize standardized chip variants defined in the AppIcons class. The changes include replacing hardcoded chip variants with calls to the new methods for event, team, and student chips, enhancing consistency across the UI. Additionally, the UnscheduledStudentsList component has been updated to include necessary using directives, improving code clarity. These modifications contribute to a more uniform and maintainable user interface.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
{
|
||||
<span class="numberCircle">@EventDefinition.LevelOfEffort</span>
|
||||
} *@
|
||||
<MudChip T="string" Color="Color.Default" Variant="Variant.Filled" Style="background-color: white; font-family: monospace; white-space: pre;">
|
||||
<MudChip T="string" Color="Color.Default" Variant="@AppIcons.EventChipVariant()" Style="background-color: white; font-family: monospace; white-space: pre;">
|
||||
@{
|
||||
var loeIcon = AppIcons.LevelOfEffortIcon(EventDefinition.LevelOfEffort);
|
||||
var loeColor = AppIcons.IconColors.GetValueOrDefault(loeIcon, "inherit");
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
<div @onclick="@(() => OnToggleTeam.InvokeAsync(team))" style="cursor: pointer; display: inline-block;">
|
||||
<MudChip T="string"
|
||||
Size="Size.Small"
|
||||
Color="Color.Default">
|
||||
Color="Color.Default"
|
||||
Variant="@AppIcons.TeamChipVariant()">
|
||||
@team
|
||||
</MudChip>
|
||||
</div>
|
||||
@@ -59,7 +60,7 @@
|
||||
{
|
||||
<InteractiveChip Size="Size.Small"
|
||||
Color="@chipColor"
|
||||
Variant="Variant.Outlined"
|
||||
Variant="@AppIcons.StudentChipVariant()"
|
||||
Style="@(isExcluded ? "opacity: 0.5;" : "")">
|
||||
<ChildContent>
|
||||
<span>@formattedName</span>
|
||||
@@ -79,7 +80,7 @@
|
||||
<MudChip T="string"
|
||||
Size="Size.Small"
|
||||
Color="@chipColor"
|
||||
Variant="Variant.Outlined"
|
||||
Variant="@AppIcons.StudentChipVariant()"
|
||||
Style="@(isExcluded ? "opacity: 0.5;" : "")">
|
||||
<span>@formattedName</span>
|
||||
</MudChip>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@using Core.Calculation
|
||||
@using Core.Utility
|
||||
@using WebApp.Models
|
||||
|
||||
@if (UnscheduledStudents.Any())
|
||||
{
|
||||
@@ -18,7 +19,7 @@
|
||||
}
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
|
||||
<MudChip T="string" Size="Size.Small" Variant="Variant.Outlined" Class="font-style-italic">
|
||||
<MudChip T="string" Size="Size.Small" Variant="@AppIcons.StudentChipVariant()" Class="font-style-italic">
|
||||
@formattedName
|
||||
</MudChip>
|
||||
</MudStack>
|
||||
@@ -40,7 +41,8 @@
|
||||
<div @onclick="@(() => OnToggleTeam.InvokeAsync(unassignedTeam))" style="cursor: pointer; display: inline-block;">
|
||||
<MudChip T="string"
|
||||
Size="Size.Small"
|
||||
Color="@chipColor">
|
||||
Color="@chipColor"
|
||||
Variant="@AppIcons.TeamChipVariant()">
|
||||
@if (isScheduled)
|
||||
{
|
||||
<MudIcon Icon="@Icons.Material.Filled.Check" Size="Size.Small" Style="margin-right: 4px;" />
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
<MudTooltip Text="@teamMembers">
|
||||
<MudChip Size="Size.Small"
|
||||
Color="Color.Default"
|
||||
Variant="@AppIcons.TeamChipVariant()"
|
||||
Href="@($"/teams/edit?id={team.Id}&returnUrl=/students/teams")"
|
||||
Style="cursor: pointer;">
|
||||
@team
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
.Concat(context.Events)
|
||||
.Distinct();
|
||||
}
|
||||
<MudStack Row="true" Spacing="1" Wrap="Wrap.Wrap" AlignItems="AlignItems.Center">
|
||||
@foreach (var e in
|
||||
allStudentEvents
|
||||
.OrderBy(e =>
|
||||
@@ -194,7 +195,7 @@
|
||||
&& ar.Student == context.Student
|
||||
&& ar.Requirement == Requirement.Exclude) == null;
|
||||
|
||||
<InteractiveChip WrapperClass="mx-3 my-1" Style="@style" Variant="Variant.Text">
|
||||
<InteractiveChip WrapperClass="my-1" Style="@style" Variant="@AppIcons.EventChipVariant()">
|
||||
<ChildContent>
|
||||
@e.ShortName
|
||||
@AppIcons.EventAttributes(e)
|
||||
@@ -232,6 +233,7 @@
|
||||
</ControlContent>
|
||||
</InteractiveChip>
|
||||
}
|
||||
</MudStack>
|
||||
<MudDivider Style="border-width:3px" />
|
||||
</td></MudTr>
|
||||
</ChildRowContent>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<MudTooltip Text="@rankLabel">
|
||||
<MudChip T="string"
|
||||
Size="Size.Medium"
|
||||
Variant="Variant.Outlined"
|
||||
Variant="@AppIcons.StudentChipVariant()"
|
||||
Class="mx-1 my-1">
|
||||
@if (eventRank.HasValue)
|
||||
{
|
||||
|
||||
@@ -154,5 +154,20 @@ namespace WebApp.Models
|
||||
};
|
||||
return $"{number}<sup>{suffix}</sup>";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the standard chip variant for student chips (Outlined).
|
||||
/// </summary>
|
||||
public static Variant StudentChipVariant() => Variant.Outlined;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the standard chip variant for event chips (Filled).
|
||||
/// </summary>
|
||||
public static Variant EventChipVariant() => Variant.Filled;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the standard chip variant for team chips (Filled).
|
||||
/// </summary>
|
||||
public static Variant TeamChipVariant() => Variant.Filled;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user