Skip to content

Commit bc7dabc

Browse files
committed
Better table upper decorations.
1 parent f0997b1 commit bc7dabc

File tree

4 files changed

+46
-20
lines changed

4 files changed

+46
-20
lines changed

src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,15 @@ export class GitHubIssueAppendEnhancer
9090
<span className="flex h-4 w-4 flex-shrink-0 items-center justify-center">
9191
<IssueOpenedIcon size={16} />
9292
</span>
93-
#{spot.number}
94-
<a
95-
href={`https://${spot.domain}/${spot.slug}`}
96-
className="truncate hover:underline"
97-
>
98-
{spot.slug}
99-
</a>
93+
<span>
94+
#{spot.number} |{" "}
95+
<a
96+
href={`https://${spot.domain}/${spot.slug}`}
97+
className="truncate hover:underline"
98+
>
99+
{spot.slug}
100+
</a>
101+
</span>
100102
</>
101103
)
102104
}

src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { IssueOpenedIcon } from "@primer/octicons-react"
12
import OverType, { type OverTypeInstance } from "overtype"
23
import type {
34
CommentEnhancer,
@@ -74,13 +75,19 @@ export class GitHubIssueCreateEnhancer
7475
}
7576

7677
tableUpperDecoration(spot: GitHubIssueCreateSpot): React.ReactNode {
77-
const { slug } = spot
7878
return (
7979
<>
80-
<span>New Issue</span>
81-
<span className="font-mono text-muted-foreground text-sm">
82-
{" "}
83-
{slug}{" "}
80+
<span className="flex h-4 w-4 flex-shrink-0 items-center justify-center">
81+
<IssueOpenedIcon size={16} />
82+
</span>
83+
<span>
84+
New |{" "}
85+
<a
86+
href={`https://${spot.domain}/${spot.slug}`}
87+
className="truncate hover:underline"
88+
>
89+
{spot.slug}
90+
</a>
8491
</span>
8592
</>
8693
)

src/lib/enhancers/github/GitHubPrAppendEnhancer.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FeedPullRequestOpenIcon } from "@primer/octicons-react"
12
import OverType, { type OverTypeInstance } from "overtype"
23
import type React from "react"
34
import type {
@@ -83,11 +84,20 @@ export class GitHubPrAppendEnhancer
8384
}
8485

8586
tableUpperDecoration(spot: GitHubPrAppendSpot): React.ReactNode {
86-
const { slug, number } = spot
8787
return (
8888
<>
89-
<span className="font-mono text-muted-foreground text-sm">{slug}</span>
90-
<span className="ml-2 font-medium">PR #{number}</span>
89+
<span className="flex h-4 w-4 flex-shrink-0 items-center justify-center">
90+
<FeedPullRequestOpenIcon size={16} />
91+
</span>
92+
<span>
93+
#{spot.number} |{" "}
94+
<a
95+
href={`https://${spot.domain}/${spot.slug}`}
96+
className="truncate hover:underline"
97+
>
98+
{spot.slug}
99+
</a>
100+
</span>
91101
</>
92102
)
93103
}

src/lib/enhancers/github/GitHubPrCreateEnhancer.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FeedPullRequestOpenIcon } from "@primer/octicons-react"
12
import OverType, { type OverTypeInstance } from "overtype"
23
import type {
34
CommentEnhancer,
@@ -89,13 +90,19 @@ export class GitHubPrCreateEnhancer
8990
}
9091

9192
tableUpperDecoration(spot: GitHubPrCreateSpot): React.ReactNode {
92-
const { slug } = spot
9393
return (
9494
<>
95-
<span>New PR</span>
96-
<span className="font-mono text-muted-foreground text-sm">
97-
{" "}
98-
{slug}{" "}
95+
<span className="flex h-4 w-4 flex-shrink-0 items-center justify-center">
96+
<FeedPullRequestOpenIcon size={16} />
97+
</span>
98+
<span>
99+
New |{" "}
100+
<a
101+
href={`https://${spot.domain}/${spot.slug}`}
102+
className="truncate hover:underline"
103+
>
104+
{spot.slug}
105+
</a>
99106
</span>
100107
</>
101108
)

0 commit comments

Comments
 (0)