Migrate Navbar from StarkNet to Stellar Wallet#267
Migrate Navbar from StarkNet to Stellar Wallet#267chiscookeke11 wants to merge 10 commits intoStreamFi-x:devfrom
Conversation
|
@chiscookeke11 is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
davedumto
left a comment
There was a problem hiding this comment.
Review — Changes Requested
This PR has a critical bug and massive scope creep that must be addressed.
1. CRITICAL Bug - Wrong Property Access
Location: components/explore/Navbar.tsx line 45
const publicKey = account?.address // ❌ WRONGStellar Wallet Kit uses publicKey, not address. This should be:
const publicKey = account?.publicKey // ✅ CORRECTThis bug breaks the entire wallet display feature.
2. CRITICAL - Massive Scope Creep
Issue #236 asks to update only components/explore/Navbar.tsx. This PR changes 17 files with 12,759 additions and 5,427 deletions:
Out of scope changes:
package.json- Dependency updates unrelated to Navbarapp/globals.css- Changed primary color (line 56)components/explore/Sidebar.tsx- Complete refactorcomponents/explore/home/LiveStreams.tsx- Refactorcomponents/explore/home/TrendingStreams.tsx- Refactorcomponents/footer.tsx- Updatesdata/landing-page/community.ts- Data changes- Image file changes
- Type definition updates
This violates the single responsibility principle and makes review extremely difficult.
Please:
- Revert all changes unrelated to Navbar wallet migration
- Create separate PRs for other refactors if needed
- Keep this PR focused on ONLY what issue #236 requests
3. DRY Violations in Navbar
Duplicate display name logic:
getDisplayName()(lines 48-73)renderDisplayName()(lines 76-112)
Both have nearly identical logic. Consolidate into a single function.
Repeated sessionStorage parsing:
SessionStorage parsing with try/catch appears 3 times (lines 56-65, 93-103, 119-130). Extract to helper function:
function getSessionData<T>(key: string): T | null {
try {
const data = sessionStorage.getItem(key);
return data ? JSON.parse(data) : null;
} catch {
return null;
}
}4. API Route Rename Risk
Renamed /api/users/wallet/[wallet]/route.ts to /api/users/wallet/[publicKey]/route.ts. This could break existing code that calls the old endpoint. Please:
- Search codebase for references to the old path
- Update all callers
- Document the breaking change
5. No Tests
Zero test coverage for the wallet migration. Add tests for:
- Navbar with wallet connected/disconnected states
- Address display formatting
- Profile fetch with new endpoint
6. PR Checklist Incomplete
The PR description shows several unchecked boxes:
- ❌ "I am making a pull request against the main branch"
- ❌ "My commit messages styles matches our requested structure"
- ❌ "My code additions will fail neither code linting checks nor unit test"
- ❌ "I am only making changes to files I was requested to"
The last one is particularly concerning given the scope creep.
Summary
Before approval:
- Fix the critical bug (
account?.publicKeynotaccount?.address) - Remove all out-of-scope changes (keep only Navbar wallet migration)
- Fix DRY violations
- Verify API route rename doesn't break existing code
- Add tests
This PR needs significant rework to match the issue scope.
|
Alright |
Description
This PR updates components/explore/Navbar.tsx to replace StarkNet wallet integration with the Stellar wallet context (stellar-wallet-kit).
_Closes #236
Changes proposed
What were you told to do?
Migrate the Navbar from using StarkNet (
useAccount,useDisconnect) to the Stellar wallet context. Update address display, connect/disconnect logic, session storage, and profile fetch accordingly.What did you do?
Removed StarkNet hooks
useAccountanduseDisconnectimports removed.Added Stellar wallet hook
Imported
useWalletfromstellar-wallet-kit.Updated hook usage:
Address display updated to Stellar G-address
address.slice(...)withpublicKey.slice(...).GABCDE...WXYZConnect/Disconnect behavior updated
connect().disconnect()from Stellar wallet context.Profile fetch updated
/api/users/wallet/${address}→/api/users/wallet/${publicKey}publicKeyaswalletAddress.Truncation and display logic
getDisplayName()andrenderDisplayName()updated to handle Stellar public key.Other updates
Check List (Check all the applicable boxes)
🚨Please review the contribution guideline for this repository.
Screenshots/Videos
https://www.loom.com/share/e52926c979bb42918d77f77d0c1dd2cc