@page "/person/{Address}" @inject State State @inject IJSRuntime JS @inject NavigationManager Nav

@Address

@Address
@(Address).omg.lol Status.lol Some.pics @if(now != null){ /Now }
Open in browser
@if (bio == null) {

} else { @bio }
@if(Address == State.SelectedAddressName) { }
@if (Address == State.SelectedAddressName) { }
@if(now != null){
Open in browser
}
@code { private string _address; [Parameter] public string Address { get => _address; set { _address = value; if (StatusList != null) StatusList.StatusFunc = async (refresh) => await State.GetStatuses(_address, refresh); if (PicList != null) PicList.PicsFunc = async (refresh) => await State.GetPics(_address, refresh); } } public string ProfileUrl { get => $"https://{Address}.omg.lol/"; } public ExternalPageComponent? NowPage { get; set; } public ExternalPageComponent? ProfilePage { get; set; } private StatusList StatusList { get; set; } private PicList PicList { get; set; } private bool Editable { get => Address == State.SelectedAddressName; } private MarkupString? bio; private NowData? now; protected override async Task OnInitializedAsync() { List? garden = await State.GetNowGarden(); now = garden?.FirstOrDefault(n => n.Address == Address); await InvokeAsync(StateHasChanged); string fragment = new Uri(Nav.Uri).Fragment; await JS.InvokeVoidAsync("ui", fragment); if (fragment.EndsWith("now")) await ReloadNow(); else if (fragment.EndsWith("profile")) await ReloadProfile(); bio = await State.GetBio(Address); } private async Task ReloadNow() { if(NowPage != null) { await NowPage.Reload(); await ResizeIframes(); } } private async Task ReloadProfile() { if (ProfilePage != null) { await ProfilePage.Reload(); await ResizeIframes(); } } private async Task ResizeIframes() { await JS.InvokeVoidAsync("iframeResize", new { license = "GPLv3" }); } }