Integrated Club Verification Screen with Firebase#37
Open
prashant273000 wants to merge 3 commits into
Open
Conversation
nirvan73
requested changes
Jul 15, 2026
nirvan73
left a comment
Collaborator
There was a problem hiding this comment.
@prashant273000 Please address the reviews left
prashant273000
commented
Jul 17, 2026
prashant273000
left a comment
Author
There was a problem hiding this comment.
I have addressed all the reviews.
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.
What does this PR do?
Integrates ClubVerificationScreen into the app's navigation flow, replacing the previous placeholder. Adds status-check logic that calls UserRepository.fetchClubVerificationStatus and surfaces the result to the user via a Snackbar, and automatically navigates approved club admins to ClubDashboard.
Related Issue
Closes: #34
Brief Explanation of Approach
ClubVerificationViewModel now injects UserRepository and uses FirebaseAuth.getInstance() to get the current admin's uid. onCheckStatusClick was changed to accept two callbacks - onApproved: () -> Unit and onMessage: (String) -> Unit — instead of the screen inferring a message itself from isVerified. Inside the ViewModel:
Sets isLoading = true, calls userRepository.fetchClubVerificationStatus(uid).
Updates ClubVerificationUiState with the new verificationStatus field (added alongside the existing isVerified flag) and isLoading = false.
Branches on the returned status string:
"approved" → fires onMessage("Verification Successful!") then onApproved().
"pending" → fires a "still pending" message, no navigation.
"rejected" → fires a "contact support" message, no navigation.
any other value → falls back to showing the raw status.
Wraps the call in try/catch so network/Firestore failures reset isLoading and tell us an error message via onMessage..
ClubVerificationScreen was simplified to just pass these two callbacks through to the ViewModel, with onMessage launching a coroutine to show the Snackbar - removing the screen's own logic for deciding what message to display.
In MainActivity, the ClubVerificationScreen entry now passes:
onNavigationBack = { backStack.removeLast() }
onNavigateToDashboard = { backStack.clear(); backStack.add(ScreenRoute.App.ClubDashboard) }
Additional Notes
uid is fetched via auth.currentUser?.uid ?: return - if there's no signed-in use
Added error handling which is now in place for the status-fetch call (catch (e: Exception) → onMessage("Error checking status: ${e.message}")).
isVerified is retained in ClubVerificationUiState along with the new verificationStatus field .