fix submit button not being disabled

This commit is contained in:
keyan 2023-05-18 13:02:19 -05:00
parent 236dcae13b
commit 87e86526f8
1 changed files with 2 additions and 2 deletions

View File

@ -17,14 +17,14 @@ import { useLazyQuery } from '@apollo/client'
import { USER_SEARCH } from '../fragments/users' import { USER_SEARCH } from '../fragments/users'
export function SubmitButton ({ export function SubmitButton ({
children, variant, value, onClick, ...props children, variant, value, onClick, disabled, ...props
}) { }) {
const { isSubmitting, setFieldValue } = useFormikContext() const { isSubmitting, setFieldValue } = useFormikContext()
return ( return (
<Button <Button
variant={variant || 'main'} variant={variant || 'main'}
type='submit' type='submit'
disabled={isSubmitting} disabled={disabled || isSubmitting}
onClick={value onClick={value
? e => { ? e => {
setFieldValue('submit', value) setFieldValue('submit', value)