Initial commit
This commit is contained in:
36
Oqtane.Client/Skins/Controls/Profile.razor
Normal file
36
Oqtane.Client/Skins/Controls/Profile.razor
Normal file
@ -0,0 +1,36 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Shared
|
||||
@using Oqtane.Services;
|
||||
@using Oqtane.Models;
|
||||
@using Microsoft.JSInterop
|
||||
@inject IJSRuntime jsRuntime
|
||||
@inherits SkinObjectBase
|
||||
|
||||
<NavLink class="btn btn-primary" href="@url">@name</NavLink>
|
||||
|
||||
@functions {
|
||||
string name = "";
|
||||
string url = "";
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
var interop = new Interop(jsRuntime);
|
||||
string userid = await interop.GetCookie("user");
|
||||
|
||||
if (userid == "")
|
||||
{
|
||||
name = "Register";
|
||||
url = "register";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PageState.User != null)
|
||||
{
|
||||
name = PageState.User.DisplayName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user