Skip to content

Commit

Permalink
Improving UI
Browse files Browse the repository at this point in the history
  • Loading branch information
efonsecab committed May 4, 2024
1 parent 7866bdd commit c037ef8
Showing 1 changed file with 43 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<FluentDataGrid ItemsProvider="AspNetUsersItemsProvider" Pagination="this.paginationState">
<TemplateColumn>
<FluentButton Appearance="Appearance.Lightweight" Type="ButtonType.Button" OnClick="@( async () => await SelectUserAsync(context))"
aria-current="true">
aria-current="true">
@if (context == this.SelectedUser)
{
<strong>
Expand All @@ -50,43 +50,57 @@
</div>
</div>
<div class="col" style="max-height: 250px; overflow:auto;">
@if (this.AllMyConversationsWithSelectedUser != null)
@if (this.SelectedUser != null)
{
@foreach (var singleConversation in this.AllMyConversationsWithSelectedUser)
if (this.AllMyConversationsWithSelectedUser?.Length > 0)
{
<div class="row">
<div class="col">
<FluentCard>
<FluentHeader>
<strong>
[@singleConversation.RowCreationDateTime!.Value.LocalDateTime]
<br />
@singleConversation.FromApplicationUserFullName
</strong>
</FluentHeader>
<FluentBodyContent>
@singleConversation.Message
</FluentBodyContent>
</FluentCard>
foreach (var singleConversation in this.AllMyConversationsWithSelectedUser)
{
<div class="row">
<div class="col">
<FluentCard>
<FluentHeader>
<strong>
[@singleConversation.RowCreationDateTime!.Value.LocalDateTime]
<br />
@singleConversation.FromApplicationUserFullName
</strong>
</FluentHeader>
<FluentBodyContent>
@singleConversation.Message
</FluentBodyContent>
</FluentCard>
</div>
</div>
</div>
}
}
else
{
<p>You have no conversations with this user</p>
}
}
else
{
<p>Please select a user</p>
}
</div>
</div>
<div class="row">
<div class="col">
<EditForm Model="MessageToSend" OnValidSubmit="SendMessageAsync">
<div class="mb-3">
<DataAnnotationsValidator></DataAnnotationsValidator>
<ValidationSummary></ValidationSummary>
</div>
<div class="mb-3">
<InputText class="form-control" @bind-Value="MessageToSend!.Message">
</InputText>
<button type="submit" class="btn btn-primary">Send</button>
</div>
</EditForm>
@if (this.SelectedUser != null)
{
<FluentEditForm Model="MessageToSend" OnValidSubmit="SendMessageAsync">
<div class="mb-3">
<DataAnnotationsValidator></DataAnnotationsValidator>
<FluentValidationSummary></FluentValidationSummary>
</div>
<div class="mb-3">
<FluentTextField style="width:100%;" @bind-Value="MessageToSend!.Message">
</FluentTextField>
<FluentButton Type="ButtonType.Submit" Appearance="Appearance.Accent">Send</FluentButton>
</div>
</FluentEditForm>
}
</div>
</div>
</div>
Expand Down

0 comments on commit c037ef8

Please sign in to comment.