Convert currency display from USD to Nigerian Naira - #3
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: dapoadedire <95668340+dapoadedire@users.noreply.github.com>
Co-authored-by: dapoadedire <95668340+dapoadedire@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR successfully converts the Offloadr campus marketplace from USD to Nigerian Naira (₦) currency throughout the frontend application. The changes align with the Nigerian market context and implement a comprehensive currency conversion with appropriate price scaling (1000x multiplier for realistic Naira pricing).
Key changes implemented:
- Currency display formatting: All price displays now use Nigerian Naira symbol (₦) with proper locale formatting using
toLocaleString('en-NG') - Price range filters: Updated from USD ranges ($50-$500) to Naira ranges (₦50,000-₦500,000) with new
PRICE_RANGESconstants - Form labels and placeholders: Updated input labels from "Price ($)" to "Price (₦)" with adjusted placeholder values
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/app/marketplace/page.tsx | Added PRICE_RANGES constants, updated filter labels to Naira ranges, and converted price display format |
| frontend/app/items/[id]/page.tsx | Updated item detail and related items price displays to Naira format |
| frontend/app/items/[id]/edit/page.tsx | Changed form label to "Price (₦)" and updated placeholder to "50000.00" |
| frontend/app/items/new/page.tsx | Updated form label to "Price (₦)" |
| frontend/app/my-listings/page.tsx | Converted listing price display to Naira format |
| frontend/app/favorites/page.tsx | Updated favorite items price display to Naira format |
| frontend/app/profile/[id]/page.tsx | Converted profile page item price displays to Naira format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const PRICE_RANGES = { | ||
| LOW_MAX: 50000, | ||
| MID_MIN: 50000, | ||
| MID_MAX: 100000, | ||
| HIGH_MIN: 100000, | ||
| HIGH_MAX: 500000, | ||
| PREMIUM_MIN: 500000, | ||
| }; |
There was a problem hiding this comment.
The PRICE_RANGES constant should be defined outside the component function to avoid recreating it on every render. Move this constant definition above the MarketplaceContent function declaration to improve performance.
There was a problem hiding this comment.
Moved PRICE_RANGES constant outside the component function to avoid recreation on every render. (commit ad2be85)
| render={({ field }) => ( | ||
| <FormItem> | ||
| <FormLabel>Price ($)</FormLabel> | ||
| <FormLabel>Price (₦)</FormLabel> |
There was a problem hiding this comment.
The label was updated to "Price (₦)" but the placeholder remains "0.00". For consistency with the edit page (which uses "50000.00"), consider updating the placeholder to reflect a realistic Nigerian Naira amount, such as "50000.00".
There was a problem hiding this comment.
Updated placeholder from "0.00" to "50000.00" for consistency with the edit page. (commit ad2be85)
…tency Co-authored-by: dapoadedire <95668340+dapoadedire@users.noreply.github.com>
Change All Currency to Naira ✅
This PR successfully changes all currency displays from US Dollars ($) to Nigerian Naira (₦) throughout the application, as this is a Nigerian campus marketplace tool.
Changes Completed:
Technical Details:
₦{price.toLocaleString('en-NG', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}Files Modified:
frontend/app/marketplace/page.tsx- Price display, filters, filter logic, and PRICE_RANGES optimizationfrontend/app/items/[id]/page.tsx- Item detail and related items price displayfrontend/app/items/[id]/edit/page.tsx- Edit form price label and placeholderfrontend/app/items/new/page.tsx- New item form price label and placeholderfrontend/app/my-listings/page.tsx- Listing card price displayfrontend/app/favorites/page.tsx- Favorite item card price displayfrontend/app/profile/[id]/page.tsx- User profile item price displaySecurity Summary:
No security vulnerabilities introduced. All changes are cosmetic, affecting only the display formatting of existing price data. The underlying data structure and validation remain unchanged.
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.