Skip to content

Commit 2e18180

Browse files
committed
Added comments to NewPortfolio.razor
1 parent 73e0428 commit 2e18180

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

WebFrontend/Pages/NewPortfolio.razor

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@page "/newportfolio"
2-
@using Model
32
@using Services
43
@using Utils
4+
@using Model
55
@inject IPortfolioService PortfolioService
66
@inject IMatDialogService MatDialogService
77
@inject IMatToaster Toaster
8-
@inject Microsoft.AspNetCore.Components.NavigationManager NavigationManager
8+
@inject NavigationManager NavigationManager
99

1010

1111
<style>
@@ -18,8 +18,10 @@
1818
<div class="mat-layout-grid-inner">
1919
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-2"></div>
2020
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-8">
21-
22-
<MatH5><MatButton Outlined="true" Icon="keyboard_arrow_left" Style="margin-right: 1rem;" OnClick='() => { NavigationManager.NavigateTo($""); }'>Back</MatButton></MatH5>
21+
22+
<MatH5>
23+
<MatButton Outlined="true" Icon="keyboard_arrow_left" Style="margin-right: 1rem;" OnClick='() => { NavigationManager.NavigateTo($""); }'>Back</MatButton>
24+
</MatH5>
2325
<MatCard>
2426
<MatCardContent class="demo-mat-card-content">
2527
<h2>New portfolio</h2>
@@ -40,8 +42,11 @@
4042
{
4143
private void OnCreateFormSubmitted(PortfolioForm.NewPortfolioModel formModel)
4244
{
45+
// create the portfolio
4346
PortfolioService.CreatePortfolio(formModel.Name, formModel.Description, formModel.SelectedCurrency);
47+
// reset the model
4448
formModel.Reset();
49+
// notify the user
4550
Toaster.Add("New portfolio successfully added", MatToastType.Success, "", "");
4651
}
4752
}

0 commit comments

Comments
 (0)