Setup lang

This commit is contained in:
2023-08-27 16:25:27 +01:00
parent 80d0e4975f
commit 2669af3250
85 changed files with 1152 additions and 1515 deletions

View File

@ -15,19 +15,17 @@ export function RootPage() {
const tags = login?.follows.tags ?? [];
const followsHost = useCallback(
(ev: NostrEvent) => {
return tags.find((t) => t.at(1) === getHost(ev));
return tags.find(t => t.at(1) === getHost(ev));
},
[tags]
);
const hashtags = getTagValues(tags, "t");
const following = live.filter(followsHost);
const liveNow = live.filter((e) => !following.includes(e));
const liveNow = live.filter(e => !following.includes(e));
const hasFollowingLive = following.length > 0;
const plannedEvents = planned
.filter((e) => !mutedHosts.has(getHost(e)))
.filter(followsHost);
const endedEvents = ended.filter((e) => !mutedHosts.has(getHost(e)));
const plannedEvents = planned.filter(e => !mutedHosts.has(getHost(e))).filter(followsHost);
const endedEvents = ended.filter(e => !mutedHosts.has(getHost(e)));
return (
<div className="homepage">
@ -35,7 +33,7 @@ export function RootPage() {
<>
<h2 className="divider line one-line">Following</h2>
<div className="video-grid">
{following.map((e) => (
{following.map(e => (
<VideoTile ev={e} key={e.id} />
))}
</div>
@ -44,23 +42,23 @@ export function RootPage() {
{!hasFollowingLive && (
<div className="video-grid">
{live
.filter((e) => !mutedHosts.has(getHost(e)))
.map((e) => (
.filter(e => !mutedHosts.has(getHost(e)))
.map(e => (
<VideoTile ev={e} key={e.id} />
))}
</div>
)}
{hashtags.map((t) => (
{hashtags.map(t => (
<>
<h2 className="divider line one-line">#{t}</h2>
<div className="video-grid">
{live
.filter((e) => !mutedHosts.has(getHost(e)))
.filter((e) => {
.filter(e => !mutedHosts.has(getHost(e)))
.filter(e => {
const evTags = getTagValues(e.tags, "t");
return evTags.includes(t);
})
.map((e) => (
.map(e => (
<VideoTile ev={e} key={e.id} />
))}
</div>
@ -71,8 +69,8 @@ export function RootPage() {
<h2 className="divider line one-line">Live</h2>
<div className="video-grid">
{liveNow
.filter((e) => !mutedHosts.has(getHost(e)))
.map((e) => (
.filter(e => !mutedHosts.has(getHost(e)))
.map(e => (
<VideoTile ev={e} key={e.id} />
))}
</div>
@ -82,7 +80,7 @@ export function RootPage() {
<>
<h2 className="divider line one-line">Planned</h2>
<div className="video-grid">
{plannedEvents.map((e) => (
{plannedEvents.map(e => (
<VideoTile ev={e} key={e.id} />
))}
</div>
@ -92,7 +90,7 @@ export function RootPage() {
<>
<h2 className="divider line one-line">Ended</h2>
<div className="video-grid">
{endedEvents.map((e) => (
{endedEvents.map(e => (
<VideoTile ev={e} key={e.id} />
))}
</div>