Skip to content

Commit 9bc6ae5

Browse files
feat(details): add a lock icon if the issue/PR is locked, adjust title size
1 parent 9ee49b9 commit 9bc6ae5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/routes/[pullOrIssue=poi]/[org]/[repo]/[id=number]/PageRenderer.svelte

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
ChevronLeft,
2626
FileDiff,
2727
GitCommitVertical,
28+
Lock,
2829
MessagesSquare
2930
} from "@lucide/svelte";
3031
import rehypeShikiFromHighlighter from "@shikijs/rehype/core";
@@ -109,12 +110,12 @@
109110
</script>
110111

111112
<div class="container py-8">
112-
<h2 class="group mb-8 scroll-m-20 border-b pb-2 font-semibold xs:text-3xl">
113+
<h2 class="group mb-8 scroll-m-20 border-b pb-2 text-2xl font-semibold xs:text-3xl">
113114
<a href={info.html_url}>
114115
<MarkdownRenderer
115116
markdown={info.title}
116117
inline
117-
class="prose-xl text-foreground group-hover:underline xs:prose-2xl xs:text-3xl"
118+
class="prose-xl text-2xl text-foreground group-hover:underline xs:prose-2xl xs:text-3xl"
118119
/>
119120
<span class="ml-1 font-light text-muted-foreground group-hover:underline">#{info.number}</span
120121
>
@@ -177,10 +178,18 @@
177178
{/each}
178179
</Accordion.Root>
179180
{/if}
180-
<div class="flex items-center justify-between">
181+
<div class="flex items-center">
181182
<h3 class="text-2xl font-semibold tracking-tight">
182183
{metadata.type === "pull" ? "Pull request" : "Issue"}
183184
</h3>
185+
{#if info.locked}
186+
<div
187+
class="flex ml-auto items-center rounded-full px-2 xs:px-4 py-2 text-white bg-neutral-500/70 dark:bg-neutral-500/50"
188+
>
189+
<Lock class="size-5" />
190+
<span class="font-semibold ml-2 hidden xs:inline">Locked</span>
191+
</div>
192+
{/if}
184193
<GHBadge
185194
type={metadata.type}
186195
status={info.state === "closed"
@@ -194,6 +203,7 @@
194203
: info.draft
195204
? "draft"
196205
: "open"}
206+
class={{ "ml-auto": !info.locked, "ml-3 xs:ml-4": info.locked }}
197207
/>
198208
</div>
199209
<div class="mt-4 flex flex-col gap-4">

0 commit comments

Comments
 (0)