Skip to content

Commit e9d3c45

Browse files
committed
refactor: Reorganized the report header layout in ReportContent.tsx and refined the ShareButton component's layout, button padding, and expiration date display.
1 parent 9baf476 commit e9d3c45

File tree

2 files changed

+38
-42
lines changed

2 files changed

+38
-42
lines changed

src/app/report/[scan_id]/ReportContent.tsx

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -196,41 +196,19 @@ export function ReportContent({
196196
return (
197197
<div className="min-h-screen bg-black text-white p-4 md:p-8 selection:bg-indigo-500/30">
198198
<div className="max-w-4xl mx-auto space-y-8" ref={reportRef}>
199-
<div className="space-y-4">
200-
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
201-
<div className="flex items-center gap-2 text-indigo-400">
202-
<Shield className="w-6 h-6" />
203-
<h1 className="text-xl font-medium tracking-tight">
204-
{isSharedView ? "RepoMind Shared Security Report" : "RepoMind Security Report"}
205-
</h1>
206-
</div>
207-
<div className="flex flex-wrap items-center gap-2 print:hidden">
208-
<button
209-
onClick={() => router.push(`/chat?q=${encodeURIComponent(`${scan.owner}/${scan.repo}`)}`)}
210-
className="flex items-center justify-center gap-2 px-4 py-2 bg-zinc-800 hover:bg-zinc-700 text-white rounded-xl text-sm font-medium transition-all border border-white/5 whitespace-nowrap"
211-
>
212-
<MessageCircle className="w-4 h-4" />
213-
Open Repo Chat
214-
</button>
215-
{canShareReport && (
216-
<ShareButton
217-
scanId={scan.id}
218-
canGenerateOutreach={canGenerateOutreach}
219-
shareMode={shareMode}
220-
reportExpiresAt={reportExpiresAt}
221-
/>
222-
)}
223-
</div>
224-
</div>
225-
226-
<div className="p-6 bg-zinc-900 border border-white/10 rounded-2xl shadow-xl flex flex-col md:flex-row md:items-center justify-between gap-4">
227-
<div>
228-
<div className="flex items-center gap-2 mb-1">
229-
<h2 className="text-2xl font-semibold text-white">
230-
<span className="text-zinc-500 font-normal">{scan.owner} / </span>
231-
{scan.repo}
232-
</h2>
199+
<div className="p-6 bg-zinc-900 border border-white/10 rounded-2xl shadow-xl">
200+
<div className="flex flex-col lg:flex-row lg:items-start lg:justify-between gap-5">
201+
<div className="space-y-3">
202+
<div className="flex items-center gap-2 text-indigo-400">
203+
<Shield className="w-5 h-5" />
204+
<span className="text-sm font-medium tracking-wide uppercase">
205+
{isSharedView ? "Shared Security Report" : "Security Report"}
206+
</span>
233207
</div>
208+
<h1 className="text-2xl md:text-3xl font-semibold text-white tracking-tight">
209+
<span className="text-zinc-500 font-normal">{scan.owner} / </span>
210+
{scan.repo}
211+
</h1>
234212
<div className="text-sm text-zinc-400 flex flex-wrap items-center gap-3">
235213
<span>Scanned on {date.toLocaleDateString()} at {date.toLocaleTimeString()}</span>
236214
<span className="hidden sm:inline"></span>
@@ -244,11 +222,27 @@ export function ReportContent({
244222
)}
245223
</div>
246224
</div>
247-
<div className="print:hidden md:self-start">
225+
<div className="print:hidden flex flex-col gap-3 lg:items-end">
226+
<div className="flex flex-wrap items-center gap-2 lg:justify-end">
227+
<button
228+
onClick={() => router.push(`/chat?q=${encodeURIComponent(`${scan.owner}/${scan.repo}`)}`)}
229+
className="flex items-center justify-center gap-2 px-3.5 py-2 bg-zinc-800 hover:bg-zinc-700 text-white rounded-lg text-sm font-medium transition-all border border-white/10 whitespace-nowrap"
230+
>
231+
<MessageCircle className="w-4 h-4" />
232+
Open Repo Chat
233+
</button>
234+
{canShareReport && (
235+
<ShareButton
236+
scanId={scan.id}
237+
canGenerateOutreach={canGenerateOutreach}
238+
shareMode={shareMode}
239+
reportExpiresAt={reportExpiresAt}
240+
/>
241+
)}
242+
</div>
248243
<ExportButtons scan={scan} />
249244
</div>
250245
</div>
251-
252246
</div>
253247

254248
<div className="grid grid-cols-2 md:grid-cols-5 gap-4">

src/app/report/[scan_id]/ShareButton.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ export default function ShareButton({
142142
};
143143

144144
return (
145-
<div className="flex items-center gap-2">
145+
<div className="flex flex-wrap items-center gap-2">
146146
<button
147147
onClick={handleShare}
148148
disabled={isSharing}
149-
className="flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-500 hover:bg-indigo-600 rounded-lg transition-all shadow-md hover:shadow-lg active:scale-95 disabled:opacity-60"
149+
className="flex items-center gap-2 px-3.5 py-2 text-sm font-medium text-white bg-indigo-500 hover:bg-indigo-600 rounded-lg transition-all shadow-md hover:shadow-lg active:scale-95 disabled:opacity-60"
150150
title={`Report expires on ${expiryLabel}`}
151151
>
152152
<Share2 className="w-4 h-4" />
@@ -156,7 +156,7 @@ export default function ShareButton({
156156
<button
157157
onClick={handleCopyOutreachPack}
158158
disabled={isGeneratingOutreach}
159-
className="flex items-center gap-2 px-4 py-2 text-sm font-medium text-zinc-200 bg-zinc-800 hover:bg-zinc-700 rounded-lg transition-all border border-white/10 disabled:opacity-60"
159+
className="flex items-center gap-2 px-3.5 py-2 text-sm font-medium text-zinc-200 bg-zinc-800 hover:bg-zinc-700 rounded-lg transition-all border border-white/10 disabled:opacity-60"
160160
>
161161
<Megaphone className="w-4 h-4" />
162162
{isGeneratingOutreach ? "Building..." : "Outreach Pack"}
@@ -182,9 +182,11 @@ export default function ShareButton({
182182
Copy Outreach
183183
</button>
184184
)}
185-
<span className="text-xs text-zinc-400 border border-white/10 rounded-full px-2.5 py-1">
186-
Expires on {expiryLabel}
187-
</span>
185+
{activeLink && (
186+
<span className="text-xs text-zinc-400 border border-white/10 rounded-full px-2.5 py-1">
187+
Expires on {new Date(activeLink.expiresAt).toLocaleDateString()}
188+
</span>
189+
)}
188190
</div>
189191
);
190192
}

0 commit comments

Comments
 (0)