utilize _Imports.razor to simplify module declarations
This commit is contained in:
31
Oqtane.Client/Themes/Controls/UserProfile.razor
Normal file
31
Oqtane.Client/Themes/Controls/UserProfile.razor
Normal file
@ -0,0 +1,31 @@
|
||||
@namespace Oqtane.Themes.Controls
|
||||
@inherits ThemeControlBase
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<AuthorizeView>
|
||||
<Authorizing>
|
||||
<text>...</text>
|
||||
</Authorizing>
|
||||
<Authorized>
|
||||
<button type="button" class="btn btn-primary" @onclick="UpdateProfile">@context.User.Identity.Name</button>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<button type="button" class="btn btn-primary" @onclick="RegisterUser">Register</button>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
private void RegisterUser()
|
||||
{
|
||||
NavigationManager.NavigateTo(NavigateUrl("register"));
|
||||
}
|
||||
|
||||
private void UpdateProfile()
|
||||
{
|
||||
NavigationManager.NavigateTo(NavigateUrl("profile"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user