Skip to content

Commit

Permalink
use <Link/> in lineralite list view
Browse files Browse the repository at this point in the history
  • Loading branch information
alsuren committed Jan 22, 2025
1 parent 1ecb9cf commit 5a6ca11
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/linearlite/src/pages/List/IssueRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import PriorityIcon from '../../components/PriorityIcon'
import StatusIcon from '../../components/StatusIcon'
import Avatar from '../../components/Avatar'
import { memo } from 'react'
import { useNavigate } from 'react-router-dom'
import { Link } from 'react-router-dom'
import { formatDate } from '../../utils/date'
import { Issue } from '../../types/types'

Expand All @@ -19,7 +19,6 @@ interface Props {

function IssueRow({ issue, style }: Props) {
const pg = usePGlite()
const navigate = useNavigate()

const handleChangeStatus = (status: string) => {
pg.sql`
Expand Down Expand Up @@ -49,11 +48,11 @@ function IssueRow({ issue, style }: Props) {
}

return (
<div
<Link
key={issue.id}
to={`/issue/${issue.id}`}
className="flex items-center flex-grow w-full min-w-0 pl-2 pr-8 text-sm border-b border-gray-100 hover:bg-gray-100 shrink-0"
id={issue.id}
onClick={() => navigate(`/issue/${issue.id}`)}
style={style}
>
<div className="flex-shrink-0 ml-4">
Expand Down Expand Up @@ -86,7 +85,7 @@ function IssueRow({ issue, style }: Props) {
<UnsyncedIcon className="text-orange-500 w-4 h-4" />
)}
</div>
</div>
</Link>
)
}

Expand Down

0 comments on commit 5a6ca11

Please sign in to comment.