Skip to content

Commit

Permalink
Update env.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 12, 2024
1 parent fc84530 commit 9b2ba29
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const Header = ({
className="menu"
>
{
env._CURRENCIES.map((_currency) => (
env.CURRENCIES.map((_currency) => (
<MenuItem onClick={handleCurrencyMenuClose} data-code={_currency.code} key={_currency.code}>
{_currency.code}
</MenuItem>
Expand Down
9 changes: 2 additions & 7 deletions frontend/src/config/env.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ const CURRENCIES: Currency[] = [
code: 'EUR',
symbol: '€',
},
{
code: 'IQD',
symbol: 'IQD',
}
]

const env = {
Expand All @@ -60,14 +56,13 @@ const env = {
LANGUAGES: LANGUAGES.map((l) => l.code),
_LANGUAGES: LANGUAGES,
DEFAULT_LANGUAGE: String(import.meta.env.VITE_BC_DEFAULT_LANGUAGE || 'en'),
CURRENCIES: CURRENCIES.map((c) => c.code),
_CURRENCIES: CURRENCIES,
BASE_CURRENCY: String(import.meta.env.VITE_BC_BASE_CURRENCY || 'USD'),
CURRENCIES,
/**
* The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required for Stripe payments. Default is "USD".
* Must be a supported currency: https://docs.stripe.com/currencies
* */
STRIPE_CURRENCY_CODE: String(import.meta.env.VITE_BC_STRIPE_CURRENCY_CODE || 'USD'),
BASE_CURRENCY: String(import.meta.env.VITE_BC_BASE_CURRENCY || 'USD'),
PAGE_SIZE: Number.parseInt(String(import.meta.env.VITE_BC_PAGE_SIZE), 10) || 30,
CARS_PAGE_SIZE: Number.parseInt(String(import.meta.env.VITE_BC_CARS_PAGE_SIZE), 10) || 15,
BOOKINGS_PAGE_SIZE: Number.parseInt(String(import.meta.env.VITE_BC_BOOKINGS_PAGE_SIZE), 10) || 20,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/services/StripeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ export const getCurrency = () => {
* @param {string} code
* @returns {string|undefined}
*/
export const getCurrencySymbol = () => env._CURRENCIES.find((c) => c.code === getCurrency())?.symbol || '$'
export const getCurrencySymbol = () => env.CURRENCIES.find((c) => c.code === getCurrency())?.symbol || '$'

0 comments on commit 9b2ba29

Please sign in to comment.