Skip to content

Commit bf98834

Browse files
committed
feat: Add file tab to repository links in user and repo components
1 parent aca92e8 commit bf98834

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/component/dashbored/dashbored.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const Dashbored = ({user}: DashboredProps) => {
4545
<span
4646
onClick={() => nav("/u/" + user.user.name)}
4747
>{user.user.name}</span>/<span
48-
onClick={() => nav("/r/" + user.user.name + "/" + item.name)}
48+
onClick={() => nav("/r/" + user.user.name + "/" + item.name + "?tab=file")}
4949
>{item.name}</span>
5050
</div>
5151
</MenuItem>

src/component/repo/repoheader.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export const Repoheader = ({repo, owner, info}: RepoheaderProps) => {
129129
}
130130
}} variant="outline">
131131
<TabsList ref={setRootRef} className="list">
132+
<TabsTab value="intro" ref={setControlRef('intro')}>Intro</TabsTab>
132133
<TabsTab value="file" ref={setControlRef('file')}>File</TabsTab>
133134
<TabsTab value="wiki" ref={setControlRef('wiki')}>Wiki</TabsTab>
134135
<TabsTab value="issues" ref={setControlRef('issues')}>Issues</TabsTab>

src/component/user/repolist.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const UserRepoItem = (props: { repo: Repository, owner: string }) => {
4040
<Anchor href={`/u/${props.owner}`}>
4141
<b>{props.owner} / </b>
4242
</Anchor>
43-
<Anchor href={`/r/${props.owner}/${repo.name}`}>
43+
<Anchor href={`/r/${props.owner}/${repo.name}?tab=file`}>
4444
<b>{repo.name}</b>
4545
</Anchor>
4646
</div>

0 commit comments

Comments
 (0)