[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 />
|
<Sidebar />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<main>
|
<div class="main">
|
||||||
@Body
|
@Body
|
||||||
</main>
|
</div>
|
||||||
<div class="widget-panel">
|
<div class="widget-panel">
|
||||||
<WidgetPanel/>
|
<WidgetPanel/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,3 +4,6 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: var(--background-color)
|
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