refactor: centralize auth-gate strings into src/lib/constants.ts - #807
Merged
Aditya948351 merged 1 commit intoJul 8, 2026
Merged
Conversation
Contributor
Author
|
hey @Aditya948351 thank you for merging the PR, could you please add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #750 — creates
src/lib/constants.tsand extracts scattered hardcoded strings into an exported object for cleaner maintenance.Scope
Audited the codebase for hardcoded
alert()/message strings (16 files usealert()directly). The clearest, most valuable duplication was the "please log in to do X" family of messages, which appeared — with slightly different wording each time — across 8 different files. Centralized those first, since they're genuinely the same concept repeated, not just coincidentally similar text.Other one-off success/error strings (e.g. "User updated successfully.", "Failed to update user.") are more page-specific and less clearly duplicated; left them as-is for a possible follow-up rather than making this PR sprawl across all 16 files.
Changes
New:
src/lib/constants.tsMigrated 8 files to use
AUTH_MESSAGESinstead of literal strings:src/components/projects/ProjectCard.tsxsrc/components/profile/FollowButton.tsxsrc/components/profile/UserProfile.tsxsrc/components/resources/InternshipCalendarModal.tsxsrc/app/community/page.tsxsrc/app/community/view/client.tsxsrc/app/opensource/page.tsxsrc/app/u/client.tsxNo behavior or copy changes — every message renders exactly as before, just sourced from one shared file instead of being duplicated inline.
How to test
npm run devRelated Issue
Closes #750