From afe82c478e537ce5a376189045b2ab7def4da11e Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Thu, 17 Jan 2019 01:34:31 -0500
Subject: [PATCH] change: remove error modal from rewards
---
src/renderer/component/rewardLink/index.js | 30 +++++---------------
src/renderer/component/rewardLink/view.jsx | 22 +-------------
src/renderer/component/userEmailNew/view.jsx | 1 -
src/renderer/modal/modalFirstReward/view.jsx | 2 +-
src/renderer/page/rewards/view.jsx | 2 +-
src/renderer/types/reward.js | 1 +
6 files changed, 11 insertions(+), 47 deletions(-)
diff --git a/src/renderer/component/rewardLink/index.js b/src/renderer/component/rewardLink/index.js
index 7eea35460..6d4b60d5c 100644
--- a/src/renderer/component/rewardLink/index.js
+++ b/src/renderer/component/rewardLink/index.js
@@ -1,35 +1,19 @@
import { connect } from 'react-redux';
-import {
- makeSelectClaimRewardError,
- makeSelectRewardByType,
- makeSelectIsRewardClaimPending,
- doClaimRewardType,
- doClaimRewardClearError,
-} from 'lbryinc';
+import { makeSelectRewardByType, makeSelectIsRewardClaimPending, doClaimRewardType } from 'lbryinc';
import { doNavigate } from 'redux/actions/navigation';
import RewardLink from './view';
-const makeSelect = () => {
- const selectIsPending = makeSelectIsRewardClaimPending();
- const selectReward = makeSelectRewardByType();
- const selectError = makeSelectClaimRewardError();
-
- const select = (state, props) => ({
- errorMessage: selectError(state, props),
- isPending: selectIsPending(state, props),
- reward: selectReward(state, props.reward_type),
- });
-
- return select;
-};
+const select = (state, props) => ({
+ isPending: makeSelectIsRewardClaimPending()(state, props),
+ reward: makeSelectRewardByType()(state, props.reward_type),
+});
const perform = dispatch => ({
- claimReward: reward => dispatch(doClaimRewardType(reward.reward_type)),
- clearError: reward => dispatch(doClaimRewardClearError(reward)),
+ claimReward: reward => dispatch(doClaimRewardType(reward.reward_type, { notifyError: true })),
navigate: path => dispatch(doNavigate(path)),
});
export default connect(
- makeSelect,
+ select,
perform
)(RewardLink);
diff --git a/src/renderer/component/rewardLink/view.jsx b/src/renderer/component/rewardLink/view.jsx
index 7ad8a4a21..b8de1d65b 100644
--- a/src/renderer/component/rewardLink/view.jsx
+++ b/src/renderer/component/rewardLink/view.jsx
@@ -1,6 +1,5 @@
// @flow
import React from 'react';
-import { Modal } from 'modal/modal';
import Button from 'component/button';
type Reward = {
@@ -10,15 +9,13 @@ type Reward = {
type Props = {
isPending: boolean,
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, button } = props;
+ const { reward, claimReward, label, isPending, button } = props;
return !reward ? null : (
@@ -30,23 +27,6 @@ const RewardLink = (props: Props) => {
claimReward(reward);
}}
/>
- {errorMessage ? (
- // TODO: This should be moved to redux
-
{
- clearError(reward);
- }}
- >
-
-
- ) : (
- ''
- )}
);
};
diff --git a/src/renderer/component/userEmailNew/view.jsx b/src/renderer/component/userEmailNew/view.jsx
index 608509840..8c7fe887f 100644
--- a/src/renderer/component/userEmailNew/view.jsx
+++ b/src/renderer/component/userEmailNew/view.jsx
@@ -51,7 +51,6 @@ class UserEmailNew extends React.PureComponent {
'In addition, your email address will never be sold and you can unsubscribe at any time.'
)}
-