Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Added new dashboard item for league changes (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminsampica authored Nov 18, 2022
1 parent d07927d commit 05105f4
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 18 deletions.
47 changes: 47 additions & 0 deletions src/Client/Features/Dashboard/ChangeList.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<MudPaper Class="pa-4">
<MudGrid>
<MudItem xs="12">
<MudStack Row=true Class="align-center">
<MudImage Src="logo.png" Height="50" />
<PageHeader>Change Log</PageHeader>
<MudLink Href="https://github.com/benjaminsampica/DynamoLeagueBlazor/issues/new" Target="_blank" Class="ml-auto d-flex align-center" Style="gap: 3px;">
<MudIcon Icon="@Icons.Filled.QuestionAnswer" /> Want something? Tell us!
</MudLink>
</MudStack>
</MudItem>
<MudItem sm="6" xs="12">
<MudText Typo="Typo.h6" Color="Color.Success">Released Changes</MudText>
<MudList>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Success">
Auto-bidding! You can now set a maximum bid you would pay for a player and will only pay what others try to outbid you at.
</MudListItem>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Success">
Teams can now be fined. Obey the rules and don't miss dates or face the wrath of the League!
</MudListItem>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Success">
All-around performance improvements.
</MudListItem>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Success">
Light mode! Additionally, Light/Dark mode is now detected based on your device preference.
</MudListItem>
</MudList>
</MudItem>
<MudItem sm="6" xs="12">
<MudText Typo="Typo.h6" Color="Color.Info">Planned Changes</MudText>
<MudList>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Info">
Facilitating the rookie draft entirely in-house.
</MudListItem>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Info">
Higher class connectivity to the leagues in Yahoo.
</MudListItem>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Info">
Login with any provider - Google, Facebook, etc.
</MudListItem>
<MudListItem Icon="@Icons.Filled.ChevronRight" IconColor="Color.Info">
You've been outbid notifications via email.
</MudListItem>
</MudList>
</MudItem>
</MudGrid>
</MudPaper>
7 changes: 5 additions & 2 deletions src/Client/Features/Dashboard/Dashboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
</Title>

<MudGrid>
<MudItem xs=12>
<MudItem md=6 xs=12>
<TopOffenders />
</MudItem>
<MudItem xs=12>
<MudItem md=6 xs=12>
<TopTeamFines />
</MudItem>
<MudItem xs=12>
<ChangeList />
</MudItem>
</MudGrid>
4 changes: 2 additions & 2 deletions src/Client/Features/Dashboard/Shared/RankedList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
<MudItem xs=12>
@{
var first =RankedItems.First();
var first = RankedItems.First();
var second = RankedItems.Skip(1).First();
var third = RankedItems.Skip(2).First();
}
Expand All @@ -12,7 +12,7 @@
</MudItem>
@foreach(var rankedItem in RankedItems.Skip(3))
{
<MudItem xs=12 sm=4 Class="mx-auto">
<MudItem xs=12 sm=6>
<RankedCard RankedItem="@rankedItem" NameTypo=Typo.body1 AmountTypo=Typo.h6 />
</MudItem>
}
Expand Down
1 change: 0 additions & 1 deletion src/Client/Features/Dashboard/TopOffenders.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ else
Top Offenders
</PageHeader>
</MudItem>

<RankedList RankedItems="_result.Players">
<NotEnoughItemsContent>
There aren't enough players with fines quite yet. Check back later!
Expand Down
1 change: 0 additions & 1 deletion src/Client/Features/Dashboard/TopTeamFines.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ else
Top Team Fines
</PageHeader>
</MudItem>

<RankedList RankedItems="_result.Teams">
<NotEnoughItemsContent>
There aren't enough teams with fines quite yet. Check back later!
Expand Down
35 changes: 26 additions & 9 deletions src/Client/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
</MudContainer>
</MudMainContent>
<MudHidden Breakpoint=Breakpoint.LgAndUp>
<MudAppBar Elevation=3 Bottom=true Class="d-flex align-center justify-center">
<MudAppBar Elevation=3 Bottom=true Class="d-flex align-center justify-center" Color="appBarColor">
<MudToolBar>
<MudIconButton Icon=@Icons.Outlined.SupervisedUserCircle Link="/teams" Size=Size.Large Color=Color.Primary />
<MudIconButton Icon=@Icons.Outlined.People Link="/players" Size=Size.Large Color=Color.Primary />
<MudIconButton Icon=@Icons.Outlined.MoneyOff Link="/fines" Size=Size.Large Color=Color.Primary />
<MudIconButton Icon=@Icons.Outlined.FreeCancellation Link="/freeagents" Size=Size.Large Color=Color.Primary />
<MudIconButton Icon=@Icons.Outlined.SupervisedUserCircle Link="/teams" Size=Size.Large Color=buttonColor />
<MudIconButton Icon=@Icons.Outlined.People Link="/players" Size=Size.Large Color=buttonColor />
<MudIconButton Icon=@Icons.Outlined.MoneyOff Link="/fines" Size=Size.Large Color=buttonColor />
<MudIconButton Icon=@Icons.Outlined.FreeCancellation Link="/freeagents" Size=Size.Large Color=buttonColor />
</MudToolBar>
</MudAppBar>
</MudHidden>
Expand All @@ -43,12 +43,15 @@

<MudBreakpointProvider />
<MudSnackbarProvider/>
<MudThemeProvider Theme=darkTheme IsDarkMode=true/>
<MudThemeProvider @ref=_mudThemeProvider Theme=_baseTheme IsDarkMode=_isDarkMode />

@code {
private MudThemeProvider? _mudThemeProvider;
private bool _isDarkMode;
private static string[] HeaderFontFamily = new[] { "Graduate", "cursive" };

private MudTheme darkTheme = new MudTheme()
private Color buttonColor;
private Color appBarColor;
private MudTheme _baseTheme = new MudTheme()
{
Typography = new Typography
{
Expand All @@ -61,10 +64,24 @@
H6 = new H6 { FontFamily = HeaderFontFamily }
}
};

private ErrorBoundary? _errorBoundary;
private bool _showNavMenu;

protected override void OnInitialized()
{
buttonColor = _isDarkMode ? Color.Primary : Color.Dark;
appBarColor = _isDarkMode ? Color.Dark : Color.Primary;
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
_isDarkMode = await _mudThemeProvider!.GetSystemPreference();
StateHasChanged();
}
}

protected override void OnParametersSet()
{
_errorBoundary?.Recover();
Expand Down
2 changes: 1 addition & 1 deletion src/Client/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ html, body {
}

.mud-table-striped .mud-table-container .mud-table-root .mud-table-body .mud-table-row:nth-of-type(odd) {
background-color: #32333d !important;
background-color: var(--mud-palette-table-lines) !important;
}

.mud-xs-table .mud-table-row {
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Features/Admin/Users/Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task<Unit> Handle(DeleteCommand request, CancellationToken cancella
{
var user = await _userManager.FindByIdAsync(request.UserId);

await _userManager.DeleteAsync(user);
await _userManager.DeleteAsync(user!);

return Unit.Value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Infrastructure/Identity/CurrentUserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ public CurrentUserService(IHttpContextAccessor httpContextAccessor)
_httpContextAccessor = httpContextAccessor;
}

public int GetTeamId() => _httpContextAccessor.HttpContext.User.GetTeamId();
public int GetTeamId() => _httpContextAccessor.HttpContext!.User.GetTeamId();
}

0 comments on commit 05105f4

Please sign in to comment.