[frontend/components] Show inline replies on timeline (ISH-344)
This commit is contained in:
parent
f48ff0c4b3
commit
24a16f7fad
2 changed files with 38 additions and 3 deletions
|
@ -5,15 +5,29 @@
|
|||
@if (Note.Filtered is { Hide: true }) { }
|
||||
else
|
||||
{
|
||||
<div class="note-container" @onclick="OpenNote" id="@Note.Id">
|
||||
<Note NoteResponse="Note"></Note>
|
||||
<div class="note-container" id="@Note.Id">
|
||||
@if (Note.Reply is not null)
|
||||
{
|
||||
<div class="ancestor-wrapper" @onclick="() => OpenNote(Note.Reply.Id)">
|
||||
<div class="note-indent">
|
||||
<img class="user-avatar" src="@Note.User.AvatarUrl"/>
|
||||
<Line></Line>
|
||||
</div>
|
||||
<div class="note">
|
||||
<NoteComponent Note="Note.Reply" Indented="true"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="link-wrapper" @onclick="() => OpenNote(Note.RenoteId ?? Note.Id)">
|
||||
<Note NoteResponse="Note"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] [EditorRequired] public required NoteResponse Note { get; set; }
|
||||
|
||||
private void OpenNote()
|
||||
private void OpenNote(string id)
|
||||
{
|
||||
Navigation.NavigateTo(Note.RenoteId != null ? $"/notes/{Note.RenoteId}" : $"/notes/{Note.Id}");
|
||||
}
|
||||
|
|
|
@ -11,3 +11,24 @@
|
|||
margin-left: 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.note-indent {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
width: 3em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
.ancestor-wrapper {
|
||||
display: flex
|
||||
}
|
||||
|
||||
.note {
|
||||
width: 100%;
|
||||
}
|
Loading…
Add table
Reference in a new issue