feat: add following title

This commit is contained in:
verbiricha 2023-08-04 19:32:00 +02:00
parent 22a799aac7
commit 7a0491f3b7
3 changed files with 27 additions and 16 deletions

View File

@ -42,17 +42,19 @@ export function useStreamsFeed(tag?: string) {
return [];
}, [feed.data]);
const live = feedSorted.filter(
(a) => findTag(a, "status") === StreamState.Live
).sort(sortStarts);
const planned = feedSorted.filter(
(a) => findTag(a, "status") === StreamState.Planned
).sort(sortStarts);
const ended = feedSorted.filter((a) => {
const hasEnded = findTag(a, "status") === StreamState.Ended;
const recording = findTag(a, "recording") ?? "";
return hasEnded && recording?.length > 0;
}).sort(sortCreatedAt);
const live = feedSorted
.filter((a) => findTag(a, "status") === StreamState.Live)
.sort(sortStarts);
const planned = feedSorted
.filter((a) => findTag(a, "status") === StreamState.Planned)
.sort(sortStarts);
const ended = feedSorted
.filter((a) => {
const hasEnded = findTag(a, "status") === StreamState.Ended;
const recording = findTag(a, "recording") ?? "";
return hasEnded && recording?.length > 0;
})
.sort(sortCreatedAt);
return { live, planned, ended };
}

View File

@ -38,6 +38,12 @@
display: flex;
}
@media (max-width: 1020px) {
.divider {
padding: 0 8px;
}
}
.divider:after {
content: "";
flex: 1;

View File

@ -32,11 +32,14 @@ export function RootPage() {
return (
<div className="homepage">
{hasFollowingLive && (
<div className="video-grid">
{following.map((e) => (
<VideoTile ev={e} key={e.id} />
))}
</div>
<>
<h2 className="divider line one-line">Following</h2>
<div className="video-grid">
{following.map((e) => (
<VideoTile ev={e} key={e.id} />
))}
</div>
</>
)}
{!hasFollowingLive && (
<div className="video-grid">