add search term to header, rm search page autofocus

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) {