function1(provider){
const messages = defineMessages({
swal_text:{
id: '<Component>.function1.swal_text',
defaultMessage: 'see' + provider,
},
confirm_text:{
id: '<Component>.function1.confirm_text',
defaultMessage: 'Confirm',
}
});
swal({
title: 'blub',
text: this.context.intl.formatMessage(messages.swal_text),
type: 'error',
confirmButtonText: this.context.intl.formatMessage(messages.swalconfirm_text),
confirmButtonClass: 'negative ui button',
buttonsStyling: false
}).then().catch();
}
...
ComponentName.contextTypes = {
intl: React.PropTypes.object.isRequired
}; |