feat: add Money field type in settings (#2405)

Closes #2346
This commit is contained in:
Thaïs
2023-11-09 17:13:34 +01:00
committed by GitHub
parent c8eda61704
commit 0d4949484c
12 changed files with 103 additions and 50 deletions

View File

@ -1,11 +1,13 @@
import {
IconCheck,
IconCoins,
IconLink,
IconNumbers,
IconPlug,
IconTextSize,
} from '@/ui/display/icon';
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
import { Currency } from '~/generated-metadata/graphql';
import { MetadataFieldDataType } from '../types/ObjectFieldDataType';
@ -13,7 +15,14 @@ export const dataTypes: Record<
MetadataFieldDataType,
{ label: string; Icon: IconComponent; defaultValue?: unknown }
> = {
BOOLEAN: { label: 'True/False', Icon: IconCheck, defaultValue: true },
MONEY: {
label: 'Currency',
Icon: IconCoins,
defaultValue: { amount: 2000, currency: Currency.Usd },
},
NUMBER: { label: 'Number', Icon: IconNumbers, defaultValue: 2000 },
RELATION: { label: 'Relation', Icon: IconPlug },
TEXT: {
label: 'Text',
Icon: IconTextSize,
@ -21,6 +30,4 @@ export const dataTypes: Record<
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna enim, dapibus non enim in, lacinia faucibus nunc. Sed interdum ante sed felis facilisis, eget ultricies neque molestie. Mauris auctor, justo eu volutpat cursus, libero erat tempus nulla, non sodales lorem lacus a est.',
},
URL: { label: 'Link', Icon: IconLink },
BOOLEAN: { label: 'True/False', Icon: IconCheck, defaultValue: true },
RELATION: { label: 'Relation', Icon: IconPlug },
};