refs #4792 Show detail in search results

This commit is contained in:
AkiraFukushima 2024-07-02 22:32:04 +09:00
parent 247116ebcb
commit 620ba5f769
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
2 changed files with 12 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import Statuses from './search/Statuses'
import { Account } from '@/db'
import Accounts from './search/Accounts'
import Hashtags from './search/Hashtags'
import Detail from '../detail/Detail'
type Props = {
client: MegalodonInterface
@ -65,10 +66,17 @@ export default function Search(props: Props) {
}
}
const timelineClass = () => {
if (router.query.detail) {
return 'timeline-with-drawer'
}
return 'timeline'
}
return (
<>
<div className="search w-full h-full">
<section className="h-full w-full">
<div className="flex timeline-wrapper">
<section className={`h-full ${timelineClass()}`}>
<div className="w-full theme-text-primary p-2 flex justify-center" style={{ height: '56px' }}>
<form onSubmit={ev => submit(ev)}>
<Input
@ -117,6 +125,7 @@ export default function Search(props: Props) {
</TabsBody>
</Tabs>
</section>
<Detail client={props.client} account={props.account} className="detail" openMedia={props.openMedia} />
</div>
</>
)

View File

@ -12,7 +12,7 @@ export default function Hashtags(props: Props) {
const router = useRouter()
const openTag = (tag: string) => {
router.push({ query: { id: router.query.id, timeline: router.query.timeline, hashtag: tag, detail: true } })
router.push({ query: { id: router.query.id, timeline: router.query.timeline, tag: tag, detail: true } })
}
return (