Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
NEXT_PUBLIC_API_BASE_URL=https://brew.joshydavid.com/api/v1
NEXT_PUBLIC_S3_IMAGE_URL=https://your-bucket.s3.region.amazonaws.com
NEXT_PUBLIC_NOTIFICATION_BANNER=true
NEXT_PUBLIC_BANNER_MESSAGE="⚠️ Notice: AWS resources have been spun down. The backend is currently not running."
13 changes: 9 additions & 4 deletions frontend/app/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ import { usePathname } from "next/navigation";
export default function Header() {
const pathname = usePathname();
const { authData } = useAuthStatus();
const showBanner = process.env.NEXT_PUBLIC_NOTIFICATION_BANNER === "true";
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more robust configuration approach. Direct environment variable access makes testing difficult and creates tight coupling. Consider creating a configuration utility function or using a configuration context that can be easily mocked in tests.

Copilot uses AI. Check for mistakes.

return (
<>
<BannerComponent
title="⚠️&nbsp; Notice: AWS resources have been spun down. The backend is
currently not running."
/>
{showBanner && (
<BannerComponent
title={
process.env.NEXT_PUBLIC_BANNER_MESSAGE ||
"Notice: AWS resources have been spun down. The backend is currently not running."
}
/>
)}
<header className="flex flex-row items-center justify-between px-4 py-6 md:px-6">
<div>{pathname !== "/" && <BackButton />}</div>
<div className="flex items-center gap-2">
Expand Down