Skip to content

Commit

Permalink
feat(frontend): show warning for failed chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Thundernerd committed Jan 7, 2024
1 parent 9cbd648 commit 4a50b98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mangarr.Frontend/Pages/Activity/ContentItem.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
</td>
<td>@ChapterTitle</td>
<td class="align-middle">
@if (IsActive)
@if (IsFailed)
{
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" class="bi bi-exclamation-triangle-fill warning-fill" viewBox="0 0 16 16">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/>
</svg>
}
else if (IsActive)
{
<div class="progress">
<div class="progress-bar" aria-valuenow="@Progress" aria-valuemin="0" aria-valuemax="100" style="width: @Progress%">
Expand Down
1 change: 1 addition & 0 deletions src/Mangarr.Frontend/Pages/Activity/ContentItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public partial class ContentItem
[Parameter] public ChapterProgressModel? Item { get; set; }
[Parameter] public int Index { get; set; }

private bool IsFailed => Item!.IsFailed;
private bool IsActive => Item!.IsActive;
private string MangaId => Item!.MangaId;
private string MangaTitle => Item!.MangaTitle;
Expand Down
3 changes: 3 additions & 0 deletions src/Mangarr.Frontend/Pages/Activity/ContentItem.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.warning-fill {
fill: var(--bs-warning);
}
1 change: 1 addition & 0 deletions src/Mangarr.Shared/Models/ChapterProgressModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public class ChapterProgressModel
public string ChapterTitle { get; set; } = string.Empty;
public double ChapterNumber { get; set; }
public bool IsActive { get; set; } = false;
public bool IsFailed { get; set; } = false;
public int Progress { get; set; }
}

0 comments on commit 4a50b98

Please sign in to comment.