Skip to content

Commit

Permalink
added bogus and very wip groups ui
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Oct 31, 2023
1 parent 8e28872 commit 0512ad2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/web/Client/Jordnaer.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="6.6.2" />
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="FluentValidation" Version="11.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.13" PrivateAssets="all" />
Expand Down
34 changes: 34 additions & 0 deletions src/web/Client/Pages/Groups/Groups.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
@page "/groups"
@using Bogus

<h1>Grupper</h1>
<MudButton>Opret gruppe</MudButton>

@if (_groups.Count > 0)
{
<ul>
@foreach (var group in _groups)
{
<MudCard>
<MudCardContent>
<MudGrid>
<MudItem xs="12" md="6">
<MudTextField ReadOnly Label="Display Name" @bind-Value="@group.Name" />
</MudItem>
<MudItem xs="12" md="6">
<MudTextField ReadOnly Label="Description" @bind-Value="@group.ShortDescription" />
</MudItem>
<MudItem xs="12" md="6">
<MudTextField ReadOnly Label="Member Count" @bind-Value="@group.MemberCount" />
</MudItem>
</MudGrid>
</MudCardContent>
</MudCard>
}
</ul>
}

@code {
private readonly List<GroupDto> _groups = _groupFaker.Generate(20);

private static readonly Faker<GroupDto> _groupFaker = new Faker<GroupDto>()
.RuleFor(g => g.Id, f => Guid.NewGuid())
.RuleFor(g => g.Name, f => f.Company.CompanyName())
.RuleFor(g => g.ShortDescription, f => f.Lorem.Sentence())
.RuleFor(g => g.Description, f => f.Lorem.Paragraph())
.RuleFor(g => g.MemberCount, f => f.Random.Int(0, 300))
.RuleFor(g => g.CreatedUtc, f => f.Date.Past(3));
}

0 comments on commit 0512ad2

Please sign in to comment.