Update formatCurrency to use currency code from UserSettings
Changes: - Updated formatCurrency function: - Added currencyCode parameter with EUR default - Implemented Intl.NumberFormat for proper currency formatting - Added fallback for invalid currency codes - Updated component hierarchy to pass currency: - HomePage: Fetch userSettings and pass to MonthLocationList - MonthLocationList: Accept and pass currency to child components - LocationCard: Accept currency prop and use in formatCurrency - MonthCard: Accept currency prop and use in formatCurrency - ViewLocationCard: Pass currency from userSettings to formatCurrency - Removed hardcoded $ symbols, now using proper currency formatting All currency amounts now display with the user's selected currency code from their settings, using locale-appropriate formatting (hr-HR). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ export const ViewLocationCard:FC<ViewLocationCardProps> = ({location, userSettin
|
||||
{
|
||||
monthlyExpense > 0 ?
|
||||
<p className="text-[1.2rem]">
|
||||
{ t("payed-total-label") } <strong>${formatCurrency(monthlyExpense)}</strong>
|
||||
{ t("payed-total-label") } <strong>{formatCurrency(monthlyExpense, userSettings?.currency)}</strong>
|
||||
</p>
|
||||
: null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user