add search term to header, rm search page autofocus
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Martti Malmi 2023-12-04 20:54:48 +02:00
parent 386276845c
commit 6e4de8c17a
2 changed files with 8 additions and 2 deletions

View File

@ -34,7 +34,14 @@ export function Header() {
}, [pageName]);
let title: React.ReactNode = <span className="capitalize">{pageName}</span>;
if (nostrLink) {
if (location.pathname.startsWith("/search/")) {
const searchTerm = location.pathname.split("/search/")[1];
title = (
<>
<FormattedMessage defaultMessage="Search" id="xmcVZ0" />: {searchTerm}
</>
);
} else if (nostrLink) {
if (nostrLink.type === NostrPrefix.Event || nostrLink.type === NostrPrefix.Note) {
title = <NoteTitle link={nostrLink} />;
} else if (nostrLink.type === NostrPrefix.PublicKey || nostrLink.type === NostrPrefix.Profile) {

View File

@ -101,7 +101,6 @@ const SearchPage = () => {
placeholder={formatMessage({ defaultMessage: "Search...", id: "0BUTMv" })}
value={search}
onChange={e => setSearch(e.target.value)}
autoFocus={true}
/>
<Tabs tabs={SearchTab} tab={tab} setTab={setTab} />
</div>