Add disabled prop to NewObjectButtons for enhanced control over button states
This commit is contained in:
parent
69c387ca1d
commit
6af832afe5
@ -9,7 +9,8 @@ const NewObjectButtons = ({
|
||||
onSubmit,
|
||||
formValid,
|
||||
submitLoading,
|
||||
submitText = 'Done'
|
||||
submitText = 'Done',
|
||||
disabled = false
|
||||
}) => {
|
||||
return (
|
||||
<Flex justify='end'>
|
||||
@ -24,14 +25,18 @@ const NewObjectButtons = ({
|
||||
) : null}
|
||||
|
||||
{currentStep < totalSteps - 1 ? (
|
||||
<Button type='primary' disabled={!formValid} onClick={onNext}>
|
||||
<Button
|
||||
type='primary'
|
||||
disabled={!formValid || disabled}
|
||||
onClick={onNext}
|
||||
>
|
||||
Next
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
type='primary'
|
||||
loading={submitLoading}
|
||||
disabled={!formValid}
|
||||
disabled={!formValid || disabled}
|
||||
onClick={onSubmit}
|
||||
>
|
||||
{submitText}
|
||||
@ -49,7 +54,8 @@ NewObjectButtons.propTypes = {
|
||||
onSubmit: PropTypes.func.isRequired,
|
||||
formValid: PropTypes.bool.isRequired,
|
||||
submitLoading: PropTypes.bool,
|
||||
submitText: PropTypes.string
|
||||
submitText: PropTypes.string,
|
||||
disabled: PropTypes.bool
|
||||
}
|
||||
|
||||
export default NewObjectButtons
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user