Skip to content

Commit

Permalink
Merge pull request #543 from Atom-Learning/fix/create-password-types
Browse files Browse the repository at this point in the history
Fix: Override create password field `name` prop to be optional
  • Loading branch information
Marcdup1 authored Jul 18, 2023
2 parents c6da9ca + 5731da6 commit 3888446
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import { Flex } from '../flex'
import { InlineMessage } from '../inline-message'
import { PasswordField } from '../password-field'
import { PasswordInput } from '../password-input'
import { Override } from '~/utilities'

type ValidationResult = Record<string, boolean>

type CreatePasswordFieldProps = React.ComponentProps<typeof PasswordInput> &
Omit<FieldElementWrapperProps, 'label' | 'name'> & {
type CreatePasswordFieldProps = Override<
React.ComponentProps<typeof PasswordInput> & FieldElementWrapperProps,
{
label?: string
name?: string
validate: (
Expand All @@ -24,6 +26,7 @@ type CreatePasswordFieldProps = React.ComponentProps<typeof PasswordInput> &
defaultValidation: ValidationResult
messageDirection?: CSS['flexDirection']
}
>

export const CreatePasswordField = ({

Check warning on line 31 in lib/src/components/create-password-field/CreatePasswordField.tsx

View workflow job for this annotation

GitHub Actions / auto-fix

Missing return type on function
validate,
Expand Down

0 comments on commit 3888446

Please sign in to comment.