-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add feature toggle for notification banner #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
|
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a feature toggle for controlling the visibility of a notification banner in the header component. The toggle is implemented using an environment variable that allows the banner to be conditionally displayed.
- Added environment variable-based feature toggle for notification banner
- Wrapped existing banner component with conditional rendering logic
- Updated environment sample file with the new configuration option
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/app/components/Header/index.tsx | Added conditional rendering logic for banner using environment variable |
| frontend/.env.sample | Added new environment variable for notification banner toggle |
| export default function Header() { | ||
| const pathname = usePathname(); | ||
| const { authData } = useAuthStatus(); | ||
| const showBanner = process.env.NEXT_PUBLIC_NOTIFICATION_BANNER === "true"; |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
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.
| title="β οΈ Notice: AWS resources have been spun down. The backend is | ||
| currently not running." |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded banner message creates tight coupling between the feature toggle and specific content. Consider making the banner message configurable through environment variables or a separate configuration, allowing the same toggle mechanism to be reused for different notifications.
| title="β οΈ Notice: AWS resources have been spun down. The backend is | |
| currently not running." | |
| title={ | |
| process.env.NEXT_PUBLIC_BANNER_MESSAGE || | |
| "β οΈ Notice: AWS resources have been spun down. The backend is currently not running." | |
| } |
Signed-off-by: joshydavid <cxang.2022@scis.smu.edu.sg>
|



Description
What type of PR is this?
Desktop and mobile screenshots/recordings