Skip to content

Commit

Permalink
Decrease Fixture List size on a Small Screen
Browse files Browse the repository at this point in the history
Decreased the Fixture List size on a Small Screen
  • Loading branch information
John Tomlinson committed Sep 19, 2024
1 parent 484eed5 commit 7d47767
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
@if (FixturesAndResultsExist)
{
@switch (ComponentSource)
switch (ComponentSource)
{
case Enums.ComponentSource.FixturesAndResults:
case Enums.ComponentSource.Team:
<h2 style="padding-bottom: 10px;">
@FixtureDate.ToString("dddd dd MMMM yyyy")
</h2>
@if (!IsSmall)
{
<h2 style="padding-bottom: 10px;">
@FixtureDate.ToString("dddd dd MMMM yyyy")
</h2>
}
else
{
<h4 style="padding-bottom: 10px;">
@FixtureDate.ToString("dddd dd MMMM yyyy")
</h4>
}
break;
case Enums.ComponentSource.FixturesByGroup:
<h4 style="padding-bottom: 10px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public partial class FixturesAndResultsByDayComponent


private string TableStyle => ComponentSource == Enums.ComponentSource.FixturesAndResults && !IsSmall
? "width : 670px; margin-bottom: 20px;"
: "width : 480px; margin-bottom: 20px;";
? "width: 670px; margin-bottom: 20px;"
: "width: 340px; margin-bottom: 20px;";

private List<FootballShared.Models.FixtureAndResult> FixturesAndResults;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
{
<h3 style="padding-bottom: 10px;">Fixtures</h3>

<table class="table" style="width: 450px; margin-bottom: 20px;">
<table class="table" style="@TableStyle">
@foreach (var fixtureandResultByDay in FixturesAndResultsByGroupOrLeagueTableModel.FixturesAndResultsByDays)
{
<FixturesAndResultsByDayComponent ComponentSource="Enums.ComponentSource.FixturesByGroup" FixturesAndResultsByDayModel="fixtureandResultByDay"></FixturesAndResultsByDayComponent>
}
</table>
}

@code {
private bool FixturesAndResultsExist => FixturesAndResultsByGroupOrLeagueTableModel != null
&& (FixturesAndResultsByGroupOrLeagueTableModel.FixturesAndResults?.Count ?? 0) > 0;

[Parameter]
public FootballShared.Models.FixturesAndResultsByGroupOrLeagueTable FixturesAndResultsByGroupOrLeagueTableModel { get; set; }
}
<MediaQuery Media="@BlazorPro.BlazorSize.Breakpoints.SmallDown" @bind-Matches="IsSmall" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Components;

namespace FootballBlazorApp.Components;

public partial class FixturesAndResultsByGroupOrLeagueTable
{
private bool FixturesAndResultsExist => FixturesAndResultsByGroupOrLeagueTableModel != null
&& (FixturesAndResultsByGroupOrLeagueTableModel.FixturesAndResults?.Count ?? 0) > 0;

[Parameter]
public FootballShared.Models.FixturesAndResultsByGroupOrLeagueTable FixturesAndResultsByGroupOrLeagueTableModel { get; set; }

private bool IsSmall = false;

private string TableStyle => !IsSmall
? "width: 450px; margin-bottom: 20px;"
: "width: 340px; margin-bottom: 20px;";
}

0 comments on commit 7d47767

Please sign in to comment.