lbry-desktop/ui/js/component/rewardLink/view.jsx

41 lines
859 B
React
Raw Normal View History

2017-06-07 20:56:52 -04:00
import React from "react";
import Modal from "component/modal";
import Link from "component/link";
2017-05-26 12:53:32 +04:00
2017-06-07 20:56:52 -04:00
const RewardLink = props => {
2017-05-26 12:53:32 +04:00
const {
reward,
button,
claimReward,
clearError,
errorMessage,
2017-06-07 20:56:52 -04:00
isPending,
} = props;
2017-06-02 11:45:37 -04:00
2017-05-26 12:53:32 +04:00
return (
<div className="reward-link">
2017-07-20 17:35:56 -04:00
<Link
button={button ? button : "alt"}
disabled={isPending}
label={isPending ? __("Claiming...") : __("Claim Reward")}
onClick={() => {
claimReward(reward);
}}
/>
2017-06-07 20:56:52 -04:00
{errorMessage
? <Modal
isOpen={true}
contentLabel="Reward Claim Error"
className="error-modal"
onConfirmed={() => {
clearError(reward);
}}
>
{errorMessage}
</Modal>
: ""}
2017-05-26 12:53:32 +04:00
</div>
2017-06-07 20:56:52 -04:00
);
};
export default RewardLink;