feat: select default Unit for Currency field (#2996)
Closes #2347 Co-authored-by: Thais GUIGON <thaisguigon@macbook-pro.home>
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
import { CurrencyCode } from '@/object-record/field/types/CurrencyCode';
|
||||
import {
|
||||
IconCurrencyDollar,
|
||||
IconCurrencyEuro,
|
||||
IconCurrencyFrank,
|
||||
IconCurrencyPound,
|
||||
IconCurrencyYen,
|
||||
IconCurrencyYuan,
|
||||
} from '@/ui/display/icon';
|
||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||
|
||||
export const settingsFieldCurrencyCodes: Record<
|
||||
CurrencyCode,
|
||||
{ label: string; Icon: IconComponent }
|
||||
> = {
|
||||
USD: {
|
||||
label: 'United States dollar',
|
||||
Icon: IconCurrencyDollar,
|
||||
},
|
||||
EUR: {
|
||||
label: 'Euro',
|
||||
Icon: IconCurrencyEuro,
|
||||
},
|
||||
JPY: {
|
||||
label: 'Japanese yen',
|
||||
Icon: IconCurrencyYen,
|
||||
},
|
||||
GBP: {
|
||||
label: 'British pound',
|
||||
Icon: IconCurrencyPound,
|
||||
},
|
||||
CAD: {
|
||||
label: 'Canadian dollar',
|
||||
Icon: IconCurrencyDollar,
|
||||
},
|
||||
CHF: {
|
||||
label: 'Swiss franc',
|
||||
Icon: IconCurrencyFrank,
|
||||
},
|
||||
CNY: {
|
||||
label: 'Chinese yuan',
|
||||
Icon: IconCurrencyYuan,
|
||||
},
|
||||
HKD: {
|
||||
label: 'Hong Kong dollar',
|
||||
Icon: IconCurrencyDollar,
|
||||
},
|
||||
};
|
||||
@ -1,3 +1,4 @@
|
||||
import { CurrencyCode } from '@/object-record/field/types/CurrencyCode';
|
||||
import {
|
||||
IconCalendarEvent,
|
||||
IconCheck,
|
||||
@ -72,7 +73,7 @@ export const settingsFieldMetadataTypes: Partial<
|
||||
[FieldMetadataType.Currency]: {
|
||||
label: 'Currency',
|
||||
Icon: IconCoins,
|
||||
defaultValue: { amountMicros: 2000000000, currencyCode: 'USD' },
|
||||
defaultValue: { amountMicros: 2000000000, currencyCode: CurrencyCode.USD },
|
||||
},
|
||||
[FieldMetadataType.Relation]: {
|
||||
label: 'Relation',
|
||||
|
||||
Reference in New Issue
Block a user