Skip to content

Commit

Permalink
#343 - Button for creating an income.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed May 15, 2021
1 parent 68ca6ca commit 26603b0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Money.Blazor.Host/Components/Title.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@ButtonText
</button>
}

@ButtonContent
</h3>
@if (!String.IsNullOrEmpty(Sub))
{
Expand Down
3 changes: 3 additions & 0 deletions src/Money.Blazor.Host/Components/Title.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ public partial class Title

[Parameter]
public Action ButtonClick { get; set; }

[Parameter]
public RenderFragment ButtonContent { get; set; }
}
}
17 changes: 16 additions & 1 deletion src/Money.Blazor.Host/Pages/Summary.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
@typeparam T

<Money.Components.Title Icon="signal" Main="Summary" Sub="@SubTitle" ButtonText="New Expense" ButtonClick="@CreateNewExpense" />
<Title Icon="signal" Main="Summary" Sub="@SubTitle">
<ButtonContent>
<button class="btn btn-primary ml-2" @onclick="CreateNewExpense">
<Icon Identifier="minus-circle" />
<span class="d-none d-md-inline">
New Expense
</span>
</button>
<button class="btn btn-primary ml-2">
<Icon Identifier="plus-circle" />
<span class="d-none d-md-inline">
New Income
</span>
</button>
</ButtonContent>
</Title>
<ExceptionPanel />

<OutcomeCreate @ref="CreateModal" />
Expand Down

0 comments on commit 26603b0

Please sign in to comment.