mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
Add label prop to edit/new buttons
This commit is contained in:
parent
16d7f5ba5b
commit
73eeabcca2
2 changed files with 6 additions and 6 deletions
|
@ -2,12 +2,12 @@ import { Components, registerComponent } from 'meteor/vulcan:lib';
|
|||
import React from 'react';
|
||||
import { FormattedMessage, intlShape } from 'meteor/vulcan:i18n';
|
||||
|
||||
const EditButton = ({ style = 'primary', size, showId, modalProps, ...props }, { intl }) => (
|
||||
const EditButton = ({ style = 'primary', label, size, showId, modalProps, ...props }, { intl }) => (
|
||||
<Components.ModalTrigger
|
||||
label={intl.formatMessage({ id: 'datatable.edit' })}
|
||||
label={label || intl.formatMessage({ id: 'datatable.edit' })}
|
||||
component={
|
||||
<Components.Button size={size} variant={style}>
|
||||
<FormattedMessage id="datatable.edit" />
|
||||
{label || <FormattedMessage id="datatable.edit" />}
|
||||
</Components.Button>
|
||||
}
|
||||
modalProps={modalProps}
|
||||
|
|
|
@ -2,12 +2,12 @@ import { Components, registerComponent } from 'meteor/vulcan:lib';
|
|||
import React from 'react';
|
||||
import { FormattedMessage, intlShape } from 'meteor/vulcan:i18n';
|
||||
|
||||
const NewButton = ({ collection, size, style = 'primary', ...props }, { intl }) => (
|
||||
const NewButton = ({ collection, size, label, style = 'primary', ...props }, { intl }) => (
|
||||
<Components.ModalTrigger
|
||||
label={intl.formatMessage({ id: 'datatable.new' })}
|
||||
label={label || intl.formatMessage({ id: 'datatable.new' })}
|
||||
component={
|
||||
<Components.Button variant={style} size={size}>
|
||||
<FormattedMessage id="datatable.new" />
|
||||
{label || <FormattedMessage id="datatable.new" />}
|
||||
</Components.Button>
|
||||
}
|
||||
>
|
||||
|
|
Loading…
Add table
Reference in a new issue