Skip to content

Commit

Permalink
refs #4792 Show detail in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
h3poteto committed Jul 2, 2024
1 parent 247116e commit 620ba5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions renderer/components/timelines/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>
</>
)
Expand Down
2 changes: 1 addition & 1 deletion renderer/components/timelines/search/Hashtags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 620ba5f

Please sign in to comment.