chore: Update translations

This commit is contained in:
Martti Malmi 2024-01-13 18:54:14 +00:00
parent 7935d3d86a
commit 736c2577db
6 changed files with 51 additions and 70 deletions

View File

@ -24,12 +24,7 @@ const HashTagsPage = () => {
<div className="bb p">
<HashTagHeader tag={tag} />
</div>
<Timeline
key={tag}
subject={subject}
postsOnly={false}
method={"TIME_RANGE"}
/>
<Timeline key={tag} subject={subject} postsOnly={false} method={"TIME_RANGE"} />
</>
);
};

View File

@ -7,17 +7,20 @@ import { useParams } from "react-router-dom";
import Timeline from "@/Components/Feed/Timeline";
import PageSpinner from "@/Components/PageSpinner";
import { Hour } from "@/Utils/Const";
import {useMemo} from "react";
import { useMemo } from "react";
export function ListFeedPage() {
const { id } = useParams();
const link = parseNostrLink(unwrap(id));
const { data } = useEventFeed(link);
const subject = useMemo(() => ({
const subject = useMemo(
() => ({
type: "pubkey",
items: pubkeys,
discriminator: "list-feed",
}), [pubkeys]);
}),
[pubkeys],
);
if (!data) return <PageSpinner />;
if (data.kind !== EventKind.ContactList && data.kind !== EventKind.FollowSet) {
@ -28,12 +31,5 @@ export function ListFeedPage() {
);
}
const pubkeys = dedupe(data.tags.filter(a => a[0] === "p").map(a => a[1]));
return (
<Timeline
subject={subject}
postsOnly={true}
method="TIME_RANGE"
window={Hour * 12}
/>
);
return <Timeline subject={subject} postsOnly={true} method="TIME_RANGE" window={Hour * 12} />;
}

View File

@ -1,6 +1,6 @@
import { unixNow } from "@snort/shared";
import { SnortContext } from "@snort/system-react";
import {useContext, useEffect, useMemo, useState} from "react";
import { useContext, useEffect, useMemo, useState } from "react";
import { FormattedMessage } from "react-intl";
import Timeline from "@/Components/Feed/Timeline";
@ -79,25 +79,20 @@ export const GlobalTab = () => {
});
}, [relays, relay]);
const subject = useMemo(() => ({
const subject = useMemo(
() => ({
type: "global",
items: [],
relay: [relay.url],
discriminator: `all-${sha256(relay.url)}`,
}), [relay.url]);
}),
[relay.url],
);
return (
<>
{globalRelaySelector()}
{relay && (
<Timeline
subject={subject}
postsOnly={false}
method={"TIME_RANGE"}
window={600}
now={now}
/>
)}
{relay && <Timeline subject={subject} postsOnly={false} method={"TIME_RANGE"} window={600} now={now} />}
</>
);
};

View File

@ -2,17 +2,20 @@ import { useParams } from "react-router-dom";
import Timeline from "@/Components/Feed/Timeline";
import { TimelineSubject } from "@/Feed/TimelineFeed";
import {useMemo} from "react";
import { useMemo } from "react";
export const TagsTab = (params: { tag?: string }) => {
const { tag } = useParams();
const t = params.tag ?? tag ?? "";
const subject: TimelineSubject = useMemo(() => ({
const subject: TimelineSubject = useMemo(
() => ({
type: "hashtag",
items: [t],
discriminator: `tags-${t}`,
streams: true,
}), [t]);
}),
[t],
);
return <Timeline subject={subject} postsOnly={false} method={"TIME_RANGE"} />;
};

View File

@ -53,11 +53,14 @@ const SearchPage = () => {
return debounce(500, () => setKeyword(search));
}, [search]);
const subject = useMemo(() => ({
const subject = useMemo(
() => ({
type: "post_keyword",
items: [keyword + (sortPopular ? " sort:popular" : "")],
discriminator: keyword,
}), [keyword, sortPopular]);
}),
[keyword, sortPopular],
);
function tabContent() {
if (tab.value === PROFILES) {
@ -71,13 +74,7 @@ const SearchPage = () => {
return (
<>
{sortOptions()}
<Timeline
key={keyword}
subject={subject}
postsOnly={false}
method={"LIMIT_UNTIL"}
loadMore={false}
/>
<Timeline key={keyword} subject={subject} postsOnly={false} method={"LIMIT_UNTIL"} loadMore={false} />
</>
);
}

View File

@ -1,22 +1,17 @@
import Timeline from "@/Components/Feed/Timeline";
import useLogin from "@/Hooks/useLogin";
import {useMemo} from "react";
import { useMemo } from "react";
export function TopicsPage() {
const { tags, pubKey } = useLogin(s => ({ tags: s.tags.item, pubKey: s.publicKey }));
const subject = useMemo(() => ({
const subject = useMemo(
() => ({
type: "hashtag",
items: tags,
discriminator: pubKey ?? "",
}), [tags, pubKey]);
return (
<Timeline
subject={subject}
postsOnly={true}
method="TIME_RANGE"
loadMore={true}
window={60 * 60 * 6}
/>
}),
[tags, pubKey],
);
return <Timeline subject={subject} postsOnly={true} method="TIME_RANGE" loadMore={true} window={60 * 60 * 6} />;
}