Browse Source

* Fixed configuration so that it redirects users to app after

form submission.
master
Jaime Wyant 4 years ago
parent
commit
76c30ad81c
  1. 4
      531Calculator/Pages/Configure.razor
  2. 13
      531Calculator/Pages/Configure.razor.cs
  3. 3
      531Calculator/Pages/Index.razor

4
531Calculator/Pages/Configure.razor

@ -1,4 +1,6 @@
<div class="relative p-3 w-10/12 md:w-2/3 m-auto bg-white rounded">
@page "/configure"
<div class="relative p-3 w-10/12 md:w-2/3 m-auto bg-white rounded">
<p class="pt-1">It looks like your first time here. Please provide your name and PRs below.</p> <p class="pt-1">It looks like your first time here. Please provide your name and PRs below.</p>

13
531Calculator/Pages/Configure.razor.cs

@ -11,13 +11,19 @@ namespace FiveThreeOneCalculator.Pages
{ {
public partial class Configure : ComponentBase public partial class Configure : ComponentBase
{ {
[Inject] private ILogger<Configure> _logger { get; set; }
[Parameter] public string Title { get; set; }
[Inject]
private ILogger<Configure> _logger { get; set; }
[Inject] [Inject]
private UserService UserService { get; set; } private UserService UserService { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set; }
[Parameter]
public string Title { get; set; }
protected override void OnInitialized() protected override void OnInitialized()
{ {
base.OnInitialized(); base.OnInitialized();
@ -31,6 +37,7 @@ namespace FiveThreeOneCalculator.Pages
protected void OnUserEditFormSubmit(UserModel model) protected void OnUserEditFormSubmit(UserModel model)
{ {
UserService.SetUserModel(model); UserService.SetUserModel(model);
NavigationManager.NavigateTo("/");
} }
} }
} }

3
531Calculator/Pages/Index.razor

@ -1,6 +1,7 @@
@page "/" @page "/"
@inject FiveThreeOneCalculator.Services.User user @inject FiveThreeOneCalculator.Services.User user
@inject FiveThreeOneCalculator.Services.Calculator calculator @inject FiveThreeOneCalculator.Services.Calculator calculator
@inject NavigationManager navigationManager
@using Models @using Models
@ -46,5 +47,5 @@
} }
else else
{ {
<Configure />
navigationManager.NavigateTo("/configure");
} }
Loading…
Cancel
Save