2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
|
|
|
import SendTip from 'component/walletSendTip';
|
2018-09-26 19:48:07 +02:00
|
|
|
import UriIndicator from 'component/uriIndicator';
|
2020-01-03 20:56:04 +01:00
|
|
|
import I18nMessage from 'component/i18nMessage';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
closeModal: () => void,
|
|
|
|
uri: string,
|
2019-07-17 05:23:45 +02:00
|
|
|
claimIsMine: boolean,
|
2019-07-19 22:21:41 +02:00
|
|
|
isSupport: boolean,
|
2018-03-26 23:32:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class ModalSendTip extends React.PureComponent<Props> {
|
|
|
|
render() {
|
2019-07-19 22:21:41 +02:00
|
|
|
const { closeModal, uri, claimIsMine, isSupport } = this.props;
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
return (
|
2018-09-26 19:48:07 +02:00
|
|
|
<Modal
|
|
|
|
onAborted={closeModal}
|
|
|
|
isOpen
|
|
|
|
type="custom"
|
|
|
|
title={
|
2020-01-03 20:56:04 +01:00
|
|
|
claimIsMine || isSupport ? (
|
|
|
|
__('Add support to this claim')
|
|
|
|
) : (
|
|
|
|
<I18nMessage
|
|
|
|
tokens={{
|
|
|
|
url: <UriIndicator uri={uri} />,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
Send a tip to %url%
|
|
|
|
</I18nMessage>
|
|
|
|
)
|
2018-09-26 19:48:07 +02:00
|
|
|
}
|
|
|
|
>
|
2019-07-19 22:21:41 +02:00
|
|
|
<SendTip
|
|
|
|
uri={uri}
|
|
|
|
claimIsMine={claimIsMine}
|
|
|
|
isSupport={isSupport}
|
|
|
|
onCancel={closeModal}
|
|
|
|
sendTipCallback={closeModal}
|
|
|
|
/>
|
2018-03-26 23:32:43 +02:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ModalSendTip;
|