Skip to content

Commit

Permalink
Cleanup types
Browse files Browse the repository at this point in the history
  • Loading branch information
norda-gunni committed Dec 13, 2024
1 parent a5ce555 commit 61f7f17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export const ExampleForm: Form = buildForm({
phoneLabel: 'Símanúmer',
emailLabel: 'Netfang',
required: true,
phone: true,
showPhoneField: true,
phoneRequired: true,
email: true,
showEmailField: true,
emailRequired: true,
},
},
Expand Down
6 changes: 2 additions & 4 deletions libs/application/types/src/lib/Fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ export type RepeaterItem = {
activeField?: Record<string, string>,
) => boolean
dataTestId?: string
phone?: boolean
showPhoneField?: boolean
phoneRequired?: boolean
email?: boolean
showEmailField?: boolean
emailRequired?: boolean
readonly?:
| boolean
Expand Down Expand Up @@ -627,8 +627,6 @@ export type TableRepeaterField = BaseField & {
marginBottom?: ResponsiveProp<Space>
titleVariant?: TitleVariants
fields: Record<string, RepeaterItem>
phone?: boolean
email?: boolean
/**
* Maximum rows that can be added to the table.
* When the maximum is reached, the button to add a new row is disabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ interface NationalIdWithNameProps {
minAgePerson?: number
searchPersons?: boolean
searchCompanies?: boolean
phone?: boolean
email?: boolean
showPhoneField?: boolean
showEmailField?: boolean
error?: string
}

Expand Down Expand Up @@ -69,8 +69,8 @@ export const NationalIdWithName: FC<
minAgePerson,
searchPersons = true,
searchCompanies = false,
phone = false,
email = false,
showPhoneField = false,
showEmailField = false,
error,
}) => {
const fieldId = customId.length > 0 ? customId : id
Expand Down Expand Up @@ -269,9 +269,9 @@ export const NationalIdWithName: FC<
/>
</GridColumn>
</GridRow>
{(phone || email) && (
{(showPhoneField || showEmailField) && (
<GridRow>
{phone && (
{showPhoneField && (
<GridColumn span={['1/1', '1/1', '1/1', '1/2']} paddingTop={2}>
<PhoneInputController
id={phoneField}
Expand All @@ -284,7 +284,7 @@ export const NationalIdWithName: FC<
/>
</GridColumn>
)}
{email && (
{showEmailField && (
<GridColumn span={['1/1', '1/1', '1/1', '1/2']} paddingTop={2}>
<InputController
id={emailField}
Expand Down

0 comments on commit 61f7f17

Please sign in to comment.