add button prop for reward link for rewards page
This commit is contained in:
parent
330b342b5d
commit
8321ee5c32
2 changed files with 4 additions and 3 deletions
|
@ -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={() => {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue