Skip to content

Commit

Permalink
[Add] 12 No Attachment Placeholder (#140)
Browse files Browse the repository at this point in the history
* [Add] 12 No Attachment Placeholder

- added a short note to the AttachmentView, if the list of attachments is empty

---------

Co-authored-by: Timo Schauties <[email protected]>
Co-authored-by: Apollo3zehn <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2024
1 parent 64c9bc6 commit 53045a3
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/Nexus.UI/Components/AttachmentView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
Icon="@Icons.Material.Filled.Attachment" />
</MudTooltip>

<UIDialog
@bind-IsVisible="_isAttachmentDialogOpen"
Title="Attachments"
<UIDialog
@bind-IsVisible="_isAttachmentDialogOpen"
Title="Attachments"
MaxWidth="MaxWidth.ExtraSmall">
<TitleContent>
<MudText Typo="Typo.h6">
Expand All @@ -21,12 +21,18 @@
@if (_attachments is null)
{
<div class="h-full flex justify-center items-center mx-auto">
<MudProgressCircular
<MudProgressCircular
Color="Color.Primary"
Indeterminate=true />
<span class="ml-3 text-gray-400">Loading attachments ...</span>
</div>
}
else if (_attachments.Count == 0)
{
<div class="h-full flex justify-center items-center mx-auto">
<span class="ml-3 text-gray-400">There are no attachments yet!</span>
</div>
}
else
{
@foreach (var attachment in _attachments)
Expand All @@ -51,7 +57,7 @@
{
<div class="group flex items-center">
<div class="group-hover:hidden">
<MudProgressCircular
<MudProgressCircular
Color="Color.Primary"
Value="_progress"
Max="1" />
Expand All @@ -62,13 +68,13 @@
<span class="ml-2 text-sm">Uploading ...</span>
</div>
}
<MudFileUpload
T="IReadOnlyList<IBrowserFile>"

<MudFileUpload
T="IReadOnlyList<IBrowserFile>"
FilesChanged="UploadAttachmentsAsync"
MaximumFileCount="100">
<ButtonTemplate>
<MudButton
<MudButton
HtmlTag="label"
Variant="Variant.Outlined"
Color="Color.Primary"
Expand Down Expand Up @@ -107,7 +113,7 @@
try
{
await Client.Catalogs.DeleteAttachmentAsync(Catalog.Id, attachment);
await GetAttachmentsAsync();
await GetAttachmentsAsync();
}
catch (Exception ex)
{
Expand Down

0 comments on commit 53045a3

Please sign in to comment.