Skip to content

Commit

Permalink
feat(fields): Add isAddButtonDisabled to MultiZoneEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Apr 5, 2023
1 parent ce203ac commit 3457bc5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fields/MultiZoneEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type MultiZoneEditorProps = {
disabled?: boolean | undefined
error?: string | undefined
initialZone: Record<string, any>
isAddButtonDisabled?: boolean | undefined
isLabelHidden?: boolean
isLight?: boolean | undefined
label: string
Expand All @@ -37,6 +38,7 @@ export function MultiZoneEditor({
disabled = false,
error,
initialZone,
isAddButtonDisabled = false,
isLabelHidden = false,
isLight = false,
label,
Expand Down Expand Up @@ -111,7 +113,13 @@ export function MultiZoneEditor({

return (
<Fieldset className="Field-MultiZoneEditor" disabled={disabled} isLegendHidden={isLabelHidden} legend={label}>
<Button accent={Accent.SECONDARY} disabled={disabled} Icon={Plus} isFullWidth onClick={addZone}>
<Button
accent={Accent.SECONDARY}
disabled={disabled || isAddButtonDisabled}
Icon={Plus}
isFullWidth
onClick={addZone}
>
{addButtonLabel}
</Button>

Expand Down

0 comments on commit 3457bc5

Please sign in to comment.