fix note search, rm sort:popular
This commit is contained in:
parent
65552604dc
commit
2f1f2a5e97
@ -1,5 +1,5 @@
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
import { useIntl } from "react-intl";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
|
||||
import Timeline from "@/Components/Feed/Timeline";
|
||||
@ -25,7 +25,6 @@ const SearchPage = () => {
|
||||
const { formatMessage } = useIntl();
|
||||
const [search, setSearch] = useState<string>(params.keyword ?? "");
|
||||
const [keyword, setKeyword] = useState<string>(params.keyword ?? "");
|
||||
const [sortPopular, setSortPopular] = useState<boolean>(true);
|
||||
// tabs
|
||||
const SearchTab = [
|
||||
{ text: formatMessage({ defaultMessage: "Notes", id: "7+Domh" }), value: NOTES },
|
||||
@ -56,10 +55,10 @@ const SearchPage = () => {
|
||||
const subject = useMemo(
|
||||
() => ({
|
||||
type: "post_keyword",
|
||||
items: [keyword + (sortPopular ? " sort:popular" : "")],
|
||||
items: [keyword],
|
||||
discriminator: keyword,
|
||||
}),
|
||||
[keyword, sortPopular],
|
||||
[keyword],
|
||||
);
|
||||
|
||||
function tabContent() {
|
||||
@ -71,29 +70,7 @@ const SearchPage = () => {
|
||||
return <TrendingNotes />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{sortOptions()}
|
||||
<Timeline key={keyword} subject={subject} postsOnly={false} method={"LIMIT_UNTIL"} loadMore={false} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function sortOptions() {
|
||||
if (tab.value != PROFILES) return null;
|
||||
return (
|
||||
<div className="flex items-center justify-end g8">
|
||||
<FormattedMessage defaultMessage="Sort" id="RwFaYs" description="Label for sorting options for people search" />
|
||||
<select onChange={e => setSortPopular(e.target.value == "true")} value={sortPopular ? "true" : "false"}>
|
||||
<option value={"true"}>
|
||||
<FormattedMessage defaultMessage="Popular" id="mTJFgF" description="Sort order name" />
|
||||
</option>
|
||||
<option value={"false"}>
|
||||
<FormattedMessage defaultMessage="Recent" id="RjpoYG" description="Sort order name" />
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
return <Timeline key={keyword} subject={subject} postsOnly={false} method={"LIMIT_UNTIL"} loadMore={false} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -856,20 +856,12 @@
|
||||
"RhDAoS": {
|
||||
"defaultMessage": "Are you sure you want to delete {id}"
|
||||
},
|
||||
"RjpoYG": {
|
||||
"defaultMessage": "Recent",
|
||||
"description": "Sort order name"
|
||||
},
|
||||
"RoOyAh": {
|
||||
"defaultMessage": "Relays"
|
||||
},
|
||||
"Rs4kCE": {
|
||||
"defaultMessage": "Bookmark"
|
||||
},
|
||||
"RwFaYs": {
|
||||
"defaultMessage": "Sort",
|
||||
"description": "Label for sorting options for people search"
|
||||
},
|
||||
"SLZGPn": {
|
||||
"defaultMessage": "Enter a pin to encrypt your private key, you must enter this pin every time you open {site}."
|
||||
},
|
||||
@ -1458,10 +1450,6 @@
|
||||
"mKhgP9": {
|
||||
"defaultMessage": "{n,plural,=0{} =1{zapped} other{zapped}}"
|
||||
},
|
||||
"mTJFgF": {
|
||||
"defaultMessage": "Popular",
|
||||
"description": "Sort order name"
|
||||
},
|
||||
"mfe8RW": {
|
||||
"defaultMessage": "Option: {n}"
|
||||
},
|
||||
|
@ -282,10 +282,8 @@
|
||||
"RahCRH": "Expired",
|
||||
"RfhLwC": "By: {author}",
|
||||
"RhDAoS": "Are you sure you want to delete {id}",
|
||||
"RjpoYG": "Recent",
|
||||
"RoOyAh": "Relays",
|
||||
"Rs4kCE": "Bookmark",
|
||||
"RwFaYs": "Sort",
|
||||
"SLZGPn": "Enter a pin to encrypt your private key, you must enter this pin every time you open {site}.",
|
||||
"SMO+on": "Send zap to {name}",
|
||||
"SOqbe9": "Update Lightning Address",
|
||||
@ -481,7 +479,6 @@
|
||||
"mKAr6h": "Follow all",
|
||||
"mKh2HS": "File upload service",
|
||||
"mKhgP9": "{n,plural,=0{} =1{zapped} other{zapped}}",
|
||||
"mTJFgF": "Popular",
|
||||
"mfe8RW": "Option: {n}",
|
||||
"n1Whvj": "Switch",
|
||||
"nDejmx": "Unblock",
|
||||
|
@ -1,11 +1,4 @@
|
||||
import {
|
||||
EventMetadata,
|
||||
NostrEvent,
|
||||
OkResponse,
|
||||
ReqCommand,
|
||||
WorkerMessage,
|
||||
WorkerMessageCommand,
|
||||
} from "./types";
|
||||
import { EventMetadata, NostrEvent, OkResponse, ReqCommand, WorkerMessage, WorkerMessageCommand } from "./types";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
export class WorkerRelayInterface {
|
||||
|
Loading…
x
Reference in New Issue
Block a user