AddInteractionModal, AddProspectModal

This commit is contained in:
Andre Beging
2022-04-02 15:27:51 +02:00
parent 72e1df3def
commit 64b4d84b54
3 changed files with 160 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
@using FoodsharingSiegen.Contracts.Entity
@code {
private Modal ModalReference { get; set; } = null!;
private Prospect Prospect { get; set; } = new();
[Parameter] public EventCallback<Prospect> OnAdd { get; set; }
public async Task Show()
{
Prospect = new();
await ModalReference.Show();
}
private async Task AddProspect()
{
await OnAdd.InvokeAsync(Prospect);
await ModalReference.Hide();
}
}
<Modal @ref="@ModalReference">
<ModalContent Centered Size="ModalSize.Small">
<ModalHeader>
<ModalTitle>Neuling hinzufügen</ModalTitle>
<CloseButton />
</ModalHeader>
<ModalBody>
<Field>
<FieldLabel>Name</FieldLabel>
<TextEdit @bind-Text="Prospect.Name" />
</Field>
<Field>
<FieldLabel>Foodsharing-ID</FieldLabel>
<NumericEdit TValue="int" @bind-Value="Prospect.FsId"></NumericEdit>
</Field>
</ModalBody>
<ModalFooter>
<Button Color="Color.Primary" Clicked="@AddProspect">Hinzufügen</Button>
<Button Color="Color.Secondary" Clicked="ModalReference.Hide">Abbrechen</Button>
</ModalFooter>
</ModalContent>
</Modal>