2016-05-14 18:08:00 +05:30
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
|
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
|
|
|
|
|
|
|
export default function RejectionLink(props, context) {
|
|
|
|
return (
|
|
|
|
<a href="#" onClick={(event) => {
|
|
|
|
event.preventDefault();
|
|
|
|
|
2016-07-24 14:02:54 +05:30
|
|
|
context.reject(props.payload);
|
2016-05-14 18:08:00 +05:30
|
|
|
}}>
|
|
|
|
<Message {...props.label} />
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
RejectionLink.displayName = 'RejectionLink';
|
|
|
|
RejectionLink.propTypes = {
|
2016-07-24 14:02:54 +05:30
|
|
|
// eslint-disable-next-line react/forbid-prop-types
|
|
|
|
payload: PropTypes.object, // Custom payload for active state
|
2016-05-14 18:08:00 +05:30
|
|
|
label: PropTypes.shape({
|
|
|
|
id: PropTypes.string
|
|
|
|
}).isRequired
|
|
|
|
};
|
|
|
|
RejectionLink.contextTypes = {
|
|
|
|
reject: PropTypes.func.isRequired
|
|
|
|
};
|