User experience improvements
This commit is contained in:
37
Oqtane.Client/Themes/Controls/Theme/UserProfile.razor
Normal file
37
Oqtane.Client/Themes/Controls/Theme/UserProfile.razor
Normal file
@ -0,0 +1,37 @@
|
||||
@namespace Oqtane.Themes.Controls
|
||||
@inherits ThemeControlBase
|
||||
@inject IStringLocalizer<UserProfile> Localizer
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<span class="app-profile">
|
||||
<AuthorizeView>
|
||||
<Authorizing>
|
||||
<text>...</text>
|
||||
</Authorizing>
|
||||
<Authorized>
|
||||
<button type="button" class="btn btn-primary" @onclick="UpdateProfile">@context.User.Identity.Name</button>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
@if (PageState.Site.AllowRegistration)
|
||||
{
|
||||
<button type="button" class="btn btn-primary" @onclick="RegisterUser">@Localizer["Register"]</button>
|
||||
}
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
</span>
|
||||
|
||||
@code {
|
||||
|
||||
private void RegisterUser()
|
||||
{
|
||||
NavigationManager.NavigateTo(NavigateUrl("register"));
|
||||
}
|
||||
|
||||
private void UpdateProfile()
|
||||
{
|
||||
NavigationManager.NavigateTo(NavigateUrl("profile"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user