Add Feedback Functions

This commit is contained in:
Andre Beging
2025-04-01 11:34:11 +02:00
parent bf64239625
commit 6d6d79f55a
9 changed files with 435 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
@inherits FsBase
@using FoodsharingSiegen.Contracts.Enums
@inherits FsBase
@if (ShowNotNeeded)
{
@@ -25,14 +26,54 @@
</div>
</div>
@if (ShowInfo)
@if (!string.IsNullOrWhiteSpace(Info1Name))
{
<Field>
<FieldLabel>@InfoName</FieldLabel>
<FieldLabel>@Info1Name</FieldLabel>
<TextEdit @bind-Text="Interaction.Info1"></TextEdit>
</Field>
}
@if (!string.IsNullOrWhiteSpace(Info2Name))
{
<Field>
<FieldLabel>@Info2Name</FieldLabel>
<TextEdit @bind-Text="Interaction.Info2"></TextEdit>
</Field>
}
@if (AllowFeedback)
{
<div class="row">
<div class="col-sm">
<Field>
<FieldLabel>Feedback</FieldLabel>
<br/>
<Buttons>
<Button Color="Color.Danger" Outline="@(Interaction.Feedback != InteractionFeedback.Negative)" Clicked="@(() => SetFeedbackAsync(InteractionFeedback.Negative))">
<i class="fa-solid fa-thumbs-down"></i>
</Button>
<Button Color="Color.Warning" Outline="@(Interaction.Feedback != InteractionFeedback.Neutral)" Clicked="@(() => SetFeedbackAsync(InteractionFeedback.Neutral))">
<i class="fa-solid fa-circle-dot"></i>
</Button>
<Button Color="Color.Success" Outline="@(Interaction.Feedback != InteractionFeedback.Positive)" Clicked="@(() => SetFeedbackAsync(InteractionFeedback.Positive))">
<i class="fa-solid fa-thumbs-up"></i>
</Button>
</Buttons>
</Field>
</div>
@if (Interaction.Feedback == InteractionFeedback.Negative)
{
<div class="col-sm">
<Field>
<FieldLabel>Feedback Info</FieldLabel>
<TextEdit @bind-Text="Interaction.FeedbackInfo"></TextEdit>
</Field>
</div>
}
</div>
}
<div class="d-flex justify-content-end">
<Button Color="Color.Secondary" Clicked="@ModalService.Hide">Abbrechen</Button>
<Button Color="Color.Primary" Clicked="@AddInteractionAsync" Class="ml-2">OK</Button>