move search title to header

This commit is contained in:
Martti Malmi 2023-08-03 19:36:52 +03:00
parent f40ad0fb19
commit 0f34d44785
2 changed files with 11 additions and 12 deletions

View File

@ -65,6 +65,10 @@ export default class Header extends Component {
}
}
if (activeRoute.indexOf('/search/') === 0) {
title = `${t('search')}: ${decodeURIComponent(activeRoute.replace('/search/', ''))}`
}
this.setState({ title });
}

View File

@ -1,4 +1,5 @@
import FeedComponent from '../components/feed/Feed';
import Show from '../components/helpers/Show';
import OnboardingNotification from '../components/OnboardingNotification';
import PublicMessageForm from '../components/PublicMessageForm';
import { translate as t } from '../translations/Translation.mjs';
@ -22,18 +23,12 @@ class Feed extends View {
return (
<div className="flex flex-row">
<div className="flex flex-col w-full">
{this.props.keyword ? (
<h2 className="text-2xl mb-2">
{t('search')}: "{this.props.keyword}"
</h2>
) : (
<>
<OnboardingNotification />
<div className="hidden md:block px-4">
<PublicMessageForm autofocus={false} placeholder={t('whats_on_your_mind')} />
</div>
</>
)}
<Show when={!this.props.keyword}>
<OnboardingNotification />
<div className="hidden md:block px-4">
<PublicMessageForm autofocus={false} placeholder={t('whats_on_your_mind')} />
</div>
</Show>
<FeedComponent
keyword={this.props.keyword}
key={this.props.index || 'feed'}