Skip to content

Commit

Permalink
#448 - Ensure category button has same height
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Aug 5, 2024
1 parent 9544868 commit 3887ea7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Money.Blazor.Host/Components/ExpenseCreate.razor
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<strong>@category.Name</strong>
</div>
<div class="text-truncate">
<span>@category.Description</span>
<span>@EnsureHtmlWhitespace(category.Description)</span>
</div>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<strong>@category.Name</strong>
</div>
<div class="text-truncate">
<span>@category.Description</span>
<span>@EnsureHtmlWhitespace(category.Description)</span>
</div>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<strong>@category.Name</strong>
</div>
<div class="text-truncate">
<span>@category.Description</span>
<span>@EnsureHtmlWhitespace(category.Description)</span>
</div>
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Money.Blazor.Host/Components/OutcomeCreate.razor
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<strong>@category.Name</strong>
</div>
<div class="text-truncate">
<span>@category.Description</span>
<span>@EnsureHtmlWhitespace(category.Description)</span>
</div>
</button>
</div>
Expand Down
10 changes: 10 additions & 0 deletions src/Money.Blazor.Host/Helpers.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@code
{
public static MarkupString EnsureHtmlWhitespace(string text)
{
if (string.IsNullOrWhiteSpace(text))
return (MarkupString)"&nbsp;";

return (MarkupString)text;
}
}
2 changes: 1 addition & 1 deletion src/Money.Blazor.Host/Pages/Trends.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
<strong>@category.Name</strong>
</div>
<div class="text-truncate">
<span>@category.Description</span>
<span>@EnsureHtmlWhitespace(category.Description)</span>
</div>
</a>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/Money.Blazor.Host/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Money
@using static Money.Helpers
@using Money.Commands
@using Money.Components
@using Money.Components.Bootstrap
Expand Down

0 comments on commit 3887ea7

Please sign in to comment.