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,
|
onSubmit,
|
||||||
formValid,
|
formValid,
|
||||||
submitLoading,
|
submitLoading,
|
||||||
submitText = 'Done'
|
submitText = 'Done',
|
||||||
|
disabled = false
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Flex justify='end'>
|
<Flex justify='end'>
|
||||||
@ -24,14 +25,18 @@ const NewObjectButtons = ({
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{currentStep < totalSteps - 1 ? (
|
{currentStep < totalSteps - 1 ? (
|
||||||
<Button type='primary' disabled={!formValid} onClick={onNext}>
|
<Button
|
||||||
|
type='primary'
|
||||||
|
disabled={!formValid || disabled}
|
||||||
|
onClick={onNext}
|
||||||
|
>
|
||||||
Next
|
Next
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
type='primary'
|
||||||
loading={submitLoading}
|
loading={submitLoading}
|
||||||
disabled={!formValid}
|
disabled={!formValid || disabled}
|
||||||
onClick={onSubmit}
|
onClick={onSubmit}
|
||||||
>
|
>
|
||||||
{submitText}
|
{submitText}
|
||||||
@ -49,7 +54,8 @@ NewObjectButtons.propTypes = {
|
|||||||
onSubmit: PropTypes.func.isRequired,
|
onSubmit: PropTypes.func.isRequired,
|
||||||
formValid: PropTypes.bool.isRequired,
|
formValid: PropTypes.bool.isRequired,
|
||||||
submitLoading: PropTypes.bool,
|
submitLoading: PropTypes.bool,
|
||||||
submitText: PropTypes.string
|
submitText: PropTypes.string,
|
||||||
|
disabled: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NewObjectButtons
|
export default NewObjectButtons
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user