Skip to content

Commit 5e29bf4

Browse files
committed
[search/browse] link repo name to file browser; link code image to external
1 parent d5dc26c commit 5e29bf4

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

packages/web/src/app/[domain]/components/pathHeader.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,22 +223,27 @@ export const PathHeader = ({
223223
return (
224224
<div className="flex flex-row gap-2 items-center w-full overflow-hidden">
225225
{info?.icon ? (
226-
<Image
227-
src={info.icon}
228-
alt={info.codeHostName}
229-
className={`w-4 h-4 ${info.iconClassName}`}
230-
/>
231-
): (
226+
<a href={info.repoLink} target="_blank" rel="noopener noreferrer">
227+
<Image
228+
src={info.icon}
229+
alt={info.codeHostName}
230+
className={`w-4 h-4 ${info.iconClassName}`}
231+
/>
232+
</a>
233+
) : (
232234
<LaptopIcon className="w-4 h-4" />
233235
)}
234-
<Link
235-
className={clsx("font-medium", {
236-
"cursor-pointer hover:underline": info?.repoLink,
236+
<div
237+
className="font-medium cursor-pointer hover:underline"
238+
onClick={() => navigateToPath({
239+
repoName: repo.name,
240+
path: '',
241+
pathType: 'blob',
242+
revisionName: branchDisplayName,
237243
})}
238-
href={info?.repoLink ?? ""}
239244
>
240245
{info?.displayName}
241-
</Link>
246+
</div>
242247
{branchDisplayName && (
243248
<p
244249
className="text-xs font-semibold text-gray-500 dark:text-gray-400 mt-[3px] flex items-center gap-0.5"

0 commit comments

Comments
 (0)