diff --git a/package.json b/package.json index 1986032b1..337d15bf9 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "keytar": "^4.2.1", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#a22f8284110f957f3f645d42abc457ab8fb3fa8a", - "lbryinc": "lbryio/lbryinc#b3bb8c67745235ef54baea95accaedaa4bb86d4d", + "lbryinc": "lbryio/lbryinc#83c275da7a44f346ce9e796d06f30126f02b4c63", "localforage": "^1.7.1", "mammoth": "^1.4.6", "mime": "^2.3.1", 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); - }} - > -
-
{errorMessage}
-
-
- ) : ( - '' - )}
); }; 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.' )}

-
{

{__('You just earned your first reward!')}

{__( - "This reward will show in your Wallet in the top right momentarily (if it hasn't already)." + "This reward will show in your Wallet in the top left momentarily (if it hasn't already)." )}

diff --git a/src/renderer/page/rewards/view.jsx b/src/renderer/page/rewards/view.jsx index 0ad449606..1b44d0194 100644 --- a/src/renderer/page/rewards/view.jsx +++ b/src/renderer/page/rewards/view.jsx @@ -152,7 +152,7 @@ class RewardsPage extends PureComponent { 'card--disabled': isNotEligible, })} > - {rewards.map(reward => )} + {rewards.map(reward => )} {this.renderCustomRewardCode()} ); diff --git a/src/renderer/scss/component/_card.scss b/src/renderer/scss/component/_card.scss index b523b8e7a..1d2fe079d 100644 --- a/src/renderer/scss/component/_card.scss +++ b/src/renderer/scss/component/_card.scss @@ -83,7 +83,7 @@ .card__content { font-size: 1.15rem; - p:not(:last-of-type) { + p:not(:last-child) { margin-bottom: var(--spacing-vertical-medium); } } diff --git a/src/renderer/types/reward.js b/src/renderer/types/reward.js index bc2dccf70..e25bba5cf 100644 --- a/src/renderer/types/reward.js +++ b/src/renderer/types/reward.js @@ -11,4 +11,5 @@ export type Reward = { reward_version: ?string, transaction_id: ?string, updated_at: ?string, + claim_code: string, }; diff --git a/yarn.lock b/yarn.lock index d48046457..b7d8b28c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5698,9 +5698,9 @@ lbry-redux@lbryio/lbry-redux#a22f8284110f957f3f645d42abc457ab8fb3fa8a: reselect "^3.0.0" uuid "^3.3.2" -lbryinc@lbryio/lbryinc#b3bb8c67745235ef54baea95accaedaa4bb86d4d: +lbryinc@lbryio/lbryinc#83c275da7a44f346ce9e796d06f30126f02b4c63: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/b3bb8c67745235ef54baea95accaedaa4bb86d4d" + resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/83c275da7a44f346ce9e796d06f30126f02b4c63" dependencies: lbry-redux lbryio/lbry-redux#84b7d396934d57a37802aadbef71db91230a9404 reselect "^3.0.0"