Skip to content

Commit 868598b

Browse files
committed
Add environment prefix to subtitles in PageLayout and JobDetails components
1 parent de259f4 commit 868598b

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

app/components/PageLayout.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,19 @@ export default function PageLayout({ children, maxWidth = "max-w-4xl", title, su
3434
if (!title && !subtitle) {
3535
return null;
3636
}
37+
38+
const envPrefix =
39+
import.meta.env.VITE_ENV && import.meta.env.VITE_ENV !== "production"
40+
? `(${import.meta.env.VITE_ENV} environment) `
41+
: "";
42+
3743
return (
3844
<div className="text-center p-4 md:p-8 border-b border-gray-200">
3945
<h1 className="text-2xl md:text-3xl font-semibold text-gray-900 tracking-tight">{title}</h1>
40-
<p className="max-w-2xl mx-auto text-sm md:text-base text-gray-600">{subtitle}</p>
46+
<p className="max-w-2xl mx-auto text-sm md:text-base text-gray-600">
47+
{envPrefix}
48+
{subtitle}
49+
</p>
4150
</div>
4251
);
4352
};

app/routes/jobs.$jobId.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,15 @@ export default function JobDetails() {
215215
return (
216216
<PageLayout>
217217
<>
218-
<div className="px-4 md:px-8 pt-4 md:pt-6">
218+
<div className="px-4 md:px-8 pt-4 md:pt-6 flex justify-between items-center">
219219
<a href="/" className="text-cerulean-blue-600 hover:text-cerulean-blue-800 flex items-center">
220220
← Back to Verification
221221
</a>
222+
<div className="text-gray-500 text-sm">
223+
{import.meta.env.VITE_ENV && import.meta.env.VITE_ENV !== "production"
224+
? `(${import.meta.env.VITE_ENV} environment) `
225+
: ""}
226+
</div>
222227
</div>
223228

224229
<div className="p-4 md:p-8">
@@ -569,7 +574,12 @@ export default function JobDetails() {
569574
)}
570575
</div>
571576
<div className="flex flex-col items-center mt-4">
572-
<p className="text-gray-500 text-xs italic mb-1">Something is wrong? Report an issue on GitHub</p>
577+
<p className="text-gray-500 text-xs italic mb-1">
578+
{import.meta.env.VITE_ENV && import.meta.env.VITE_ENV !== "production"
579+
? `(${import.meta.env.VITE_ENV}) `
580+
: ""}
581+
Something is wrong? Report an issue on GitHub
582+
</p>
573583
<a
574584
href={generateGitHubIssueUrl(jobData, chains, serverUrl)}
575585
target="_blank"

0 commit comments

Comments
 (0)