update invite claim reward link style
This commit is contained in:
parent
88b2fcc057
commit
7a54159d01
1 changed files with 20 additions and 4 deletions
|
@ -1,14 +1,28 @@
|
|||
// @flow
|
||||
import React from 'react';
|
||||
import Modal from 'modal/modal';
|
||||
import { Modal } from 'modal/modal';
|
||||
import Button from 'component/button';
|
||||
|
||||
const RewardLink = props => {
|
||||
const { reward, button, claimReward, clearError, errorMessage, label, isPending } = props;
|
||||
type Reward = {
|
||||
reward_amount: number,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
isPending: boolean,
|
||||
label: ?string,
|
||||
errorMessage: ?string,
|
||||
reward: Reward,
|
||||
clearError: Reward => void,
|
||||
claimReward: Reward => void,
|
||||
};
|
||||
|
||||
const RewardLink = (props: Props) => {
|
||||
const { reward, claimReward, clearError, errorMessage, label, isPending } = props;
|
||||
|
||||
return !reward ? null : (
|
||||
<div className="reward-link">
|
||||
<Button
|
||||
button="primary"
|
||||
button="link"
|
||||
disabled={isPending}
|
||||
label={isPending ? __('Claiming...') : label || `${__('Get')} ${reward.reward_amount} LBC`}
|
||||
onClick={() => {
|
||||
|
@ -16,6 +30,7 @@ const RewardLink = props => {
|
|||
}}
|
||||
/>
|
||||
{errorMessage ? (
|
||||
// TODO: This should be moved to redux
|
||||
<Modal
|
||||
isOpen
|
||||
contentLabel="Reward Claim Error"
|
||||
|
@ -32,4 +47,5 @@ const RewardLink = props => {
|
|||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default RewardLink;
|
||||
|
|
Loading…
Reference in a new issue