add button prop for reward link for rewards page

This commit is contained in:
Sean Yesmunt 2018-04-23 01:17:54 -04:00
parent 330b342b5d
commit 8321ee5c32
2 changed files with 4 additions and 3 deletions

View file

@ -12,17 +12,18 @@ type Props = {
label: ?string,
errorMessage: ?string,
reward: Reward,
button: ?boolean,
clearError: Reward => void,
claimReward: Reward => void,
};
const RewardLink = (props: Props) => {
const { reward, claimReward, clearError, errorMessage, label, isPending } = props;
const { reward, claimReward, clearError, errorMessage, label, isPending, button } = props;
return !reward ? null : (
<div className="reward-link">
<Button
button="link"
button={button ? 'primary' : 'link'}
disabled={isPending}
label={isPending ? __('Claiming...') : label || `${__('Get')} ${reward.reward_amount} LBC`}
onClick={() => {

View file

@ -36,7 +36,7 @@ const RewardTile = (props: Props) => {
<Icon icon={icons.CHECK} /> {__('Reward claimed.')}
</span>
) : (
<RewardLink reward_type={reward.reward_type} />
<RewardLink button reward_type={reward.reward_type} />
))}
</div>
</section>