2024-06-07 04:25:21 +00:00
|
|
|
@inject IJSRuntime JS
|
|
|
|
|
|
|
|
<article class="no-padding">
|
2024-06-11 03:55:40 +00:00
|
|
|
<img src="@Pic.Url" loading="lazy">
|
2024-06-07 04:25:21 +00:00
|
|
|
<div class="padding">
|
|
|
|
<nav>
|
|
|
|
<a class="author" href="/person/@Pic.Address#pics">
|
|
|
|
<i class="fa-solid fa-fw fa-at"></i>@Pic.Address
|
|
|
|
</a>
|
|
|
|
<span class="max"></span>
|
|
|
|
<a class="chip transparent-border right">
|
|
|
|
<i class="fa fa-clock"></i> @Pic.RelativeTime
|
|
|
|
</a>
|
|
|
|
</nav>
|
2024-06-13 04:46:24 +00:00
|
|
|
<p>@((MarkupString)Pic.DescriptionHtml)</p>
|
2024-06-07 04:25:21 +00:00
|
|
|
<nav>
|
|
|
|
<div class="max"></div>
|
|
|
|
@if(Editable) {
|
|
|
|
<button @onclick="EditPic"><i class="fa-solid fa-pencil"></i> Edit</button>
|
|
|
|
}
|
|
|
|
<button class="transparent circle" @onclick="ShareClick">
|
|
|
|
<i class="fa-solid fa-share-nodes"></i>
|
|
|
|
</button>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
|
|
public Pic Pic {get; set;}
|
2024-06-13 10:02:51 +00:00
|
|
|
[Parameter]
|
2024-06-07 04:25:21 +00:00
|
|
|
public bool Editable { get; set; } = false;
|
|
|
|
[Parameter]
|
|
|
|
public EditPicDialog? Dialog { get; set; }
|
|
|
|
|
|
|
|
private async Task EditPic(EventArgs e){
|
|
|
|
Dialog.Pic = Pic;
|
|
|
|
// await InvokeAsync(StateHasChanged);
|
|
|
|
await JS.InvokeVoidAsync("ui", "#" + Dialog?.id);
|
|
|
|
}
|
|
|
|
|
|
|
|
public async Task ShareClick(EventArgs e){
|
|
|
|
await Share.Default.RequestAsync(new ShareTextRequest{
|
|
|
|
Uri = Pic.Url,
|
|
|
|
Text = Pic.Description,
|
|
|
|
Title = "I saw this on some.pics",
|
|
|
|
Subject = "I saw this on some.pics"
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|