Skip to content

Commit

Permalink
Feature: allow consumers to pass custom className prop to SubmitButton
Browse files Browse the repository at this point in the history
  • Loading branch information
camin-mccluskey committed Aug 23, 2023
1 parent d71b776 commit 9d167b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/SubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import type { FormStepOnSubmit } from '~/types'

type SubmitButtonProps<StepFormData extends FieldValues> = {
label?: string
className?: string
handleSubmit: UseFormHandleSubmit<StepFormData>
onSubmit: FormStepOnSubmit<StepFormData>
disabled: boolean
}

export default function SubmitButton<StepFormData extends FieldValues>({
label = 'Next',
className,
handleSubmit,
onSubmit,
disabled,
Expand All @@ -26,7 +28,7 @@ export default function SubmitButton<StepFormData extends FieldValues>({
})

return (
<button type="submit" disabled={disabled} ref={submitButtonRef}>
<button type="submit" className={className} disabled={disabled} ref={submitButtonRef}>
{label}
</button>
)
Expand Down

0 comments on commit 9d167b5

Please sign in to comment.