Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

Commit 1cac33f

Browse files
committed
Made the label of AddButton customizable
1 parent 06e7c57 commit 1cac33f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/AddButton/AddButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import AddIcon from '@material-ui/icons/Add';
77

88
const AddButton: React.FC<AddButtonProps> = props => (
99
<Button {...props} color="secondary">
10-
<AddIcon /> Add Item
10+
<AddIcon /> {props.label || 'Add Item'}
1111
</Button>
1212
);
1313

src/ArrayFieldTemplate/ArrayFieldTemplate.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ const DefaultFixedArrayFieldTemplate = (props: ArrayFieldTemplateProps) => {
152152
className="array-item-add"
153153
onClick={props.onAddClick}
154154
disabled={props.disabled || props.readonly}
155+
label={props.uiSchema.buttonLabel}
155156
/>
156157
)}
157158
</fieldset>
@@ -192,6 +193,7 @@ const DefaultNormalArrayFieldTemplate = (props: ArrayFieldTemplateProps) => {
192193
className="array-item-add"
193194
onClick={props.onAddClick}
194195
disabled={props.disabled || props.readonly}
196+
label={props.uiSchema.buttonLabel}
195197
/>
196198
</Box>
197199
</Grid>

0 commit comments

Comments
 (0)