[frontend/components] Refactor AttachmentComponent
Current implementation was unable to remove the blur when opening anything other than images
This commit is contained in:
parent
01a2483386
commit
2e45d74a4a
1 changed files with 19 additions and 24 deletions
|
@ -1,10 +1,10 @@
|
|||
@using Iceshrimp.Assets.PhosphorIcons
|
||||
@using Iceshrimp.Shared.Schemas.Web
|
||||
|
||||
<div class="wrapper" @onclick="Open" @onclick:stopPropagation="true">
|
||||
@if (Attachment.ContentType.StartsWith("image"))
|
||||
{
|
||||
<div class="wrapper" @onclick="Open" @onclick:stopPropagation="true">
|
||||
<img class="attachment @(BlurImage ? "blur-image" : "")" src="@Attachment.Url" alt="@Attachment.AltText"/>
|
||||
</div>
|
||||
}
|
||||
// else if (Attachment.ContentType == "audio/x-mod")
|
||||
// {
|
||||
|
@ -12,29 +12,24 @@
|
|||
// }
|
||||
else if (Attachment.ContentType.StartsWith("audio"))
|
||||
{
|
||||
<div class="wrapper">
|
||||
<audio controls class="attachment @(BlurImage ? "blur-image" : "")" src="@Attachment.Url"></audio>
|
||||
</div>
|
||||
}
|
||||
else if (Attachment.ContentType.StartsWith("video"))
|
||||
{
|
||||
<div class="wrapper">
|
||||
<video controls class="attachment @(BlurImage ? "blur-image" : "")">
|
||||
<source src="@Attachment.Url"/>
|
||||
</video>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="wrapper">
|
||||
<span class="attachment file @(BlurImage ? "blur-image" : "")">
|
||||
<Icon Name="Icons.DownloadSimple" Size="1.3em"/>
|
||||
<a href="@Attachment.Url" target="_blank">
|
||||
@Attachment.Url.Split("/").Last()
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] [EditorRequired] public required NoteAttachment Attachment { get; set; }
|
||||
|
|
Loading…
Add table
Reference in a new issue