Skip to content

Commit

Permalink
feat: #2011 correct typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuong Vu committed Jul 15, 2020
1 parent 1ad04c3 commit d26455d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,26 @@ const { statusField, hasDirectDebitField } = formFields
export type DirectDebitSectionProps = {
setFieldValue: (field: string, value: any, shouldValidate?: boolean | undefined) => void
values: AccountsInformationFormValues
setIsSubmittedDebit: React.Dispatch<boolean>
setIsSubmittedDebit: React.Dispatch<React.SetStateAction<boolean>>
}

type DirectDebitModalProps = Pick<ModalPropsV2, 'onClose' | 'visible'> & {
onFinish: () => any
}

export const handleToggleModal = (setIsOpenDirectDebitModal: React.Dispatch<boolean>, state: boolean) => () =>
setIsOpenDirectDebitModal(state)
export const handleToggleModal = (
setIsOpenDirectDebitModal: React.Dispatch<React.SetStateAction<boolean>>,
state: boolean,
) => () => setIsOpenDirectDebitModal(state)

export const handleFinish = ({
setIsOpenDirectDebitModal,
setFieldValue,
setIsSubmittedDebit,
}: {
setIsOpenDirectDebitModal: React.Dispatch<boolean>
setIsOpenDirectDebitModal: React.Dispatch<React.SetStateAction<boolean>>
setFieldValue: DirectDebitSectionProps['setFieldValue']
setIsSubmittedDebit: React.Dispatch<boolean>
setIsSubmittedDebit: React.Dispatch<React.SetStateAction<boolean>>
}) => () => {
setIsOpenDirectDebitModal(false)
setFieldValue(statusField.name, 'pending')
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/developer-portal/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d26455d

Please sign in to comment.