[frontend] placeholder timeline
This commit is contained in:
parent
2ead364a97
commit
a36a48bf34
6 changed files with 51 additions and 2 deletions
29
Iceshrimp.Frontend/Components/TimelineComponent.razor
Normal file
29
Iceshrimp.Frontend/Components/TimelineComponent.razor
Normal file
|
@ -0,0 +1,29 @@
|
|||
@using Iceshrimp.Frontend.Core.Miscellaneous
|
||||
@using Iceshrimp.Frontend.Core.Services
|
||||
@using Iceshrimp.Shared.Schemas
|
||||
@inject ApiService ApiService
|
||||
@if (_init)
|
||||
{
|
||||
@foreach (var note in Timeline)
|
||||
{
|
||||
<TimelineNote Note="note" />
|
||||
}
|
||||
}
|
||||
|
||||
@code {
|
||||
private List<NoteResponse> Timeline { get; set; } = [];
|
||||
private bool _init = false;
|
||||
|
||||
public async Task Initialize()
|
||||
{
|
||||
var res = await ApiService.Timelines.GetHomeTimeline(new PaginationQuery() { Limit = 50 });
|
||||
Timeline = res;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Initialize();
|
||||
_init = true;
|
||||
}
|
||||
|
||||
}
|
|
@ -4,9 +4,9 @@
|
|||
<Sidebar />
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<div class="main">
|
||||
@Body
|
||||
</main>
|
||||
</div>
|
||||
<div class="widget-panel">
|
||||
<WidgetPanel/>
|
||||
</div>
|
||||
|
|
|
@ -3,4 +3,7 @@
|
|||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
background-color: var(--background-color)
|
||||
}
|
||||
.main {
|
||||
width: 100%;
|
||||
}
|
9
Iceshrimp.Frontend/Pages/TimelinePage.razor
Normal file
9
Iceshrimp.Frontend/Pages/TimelinePage.razor
Normal file
|
@ -0,0 +1,9 @@
|
|||
@page "/"
|
||||
@using Iceshrimp.Frontend.Components
|
||||
<div class="scroller">
|
||||
<TimelineComponent />
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
8
Iceshrimp.Frontend/Pages/TimelinePage.razor.css
Normal file
8
Iceshrimp.Frontend/Pages/TimelinePage.razor.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
.scroller {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: scroll;
|
||||
max-height: 100vh;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
}
|
Loading…
Add table
Reference in a new issue