diff --git a/ui/js/actions/rewards.js b/ui/js/actions/rewards.js index 751bd79df..95ae3b25b 100644 --- a/ui/js/actions/rewards.js +++ b/ui/js/actions/rewards.js @@ -1,4 +1,5 @@ import * as types from "constants/action_types"; +import * as modals from "constants/modal_types"; import lbryio from "lbryio"; import rewards from "rewards"; import { selectRewardsByType } from "selectors/rewards"; @@ -58,6 +59,12 @@ export function doClaimReward(reward, saveError = false) { reward, }, }); + if (reward.reward_type == rewards.TYPE_NEW_USER) { + dispatch({ + type: types.OPEN_MODAL, + data: { modal: modals.FIRST_REWARD }, + }); + } }; const failure = error => { diff --git a/ui/js/actions/user.js b/ui/js/actions/user.js index dad5e7624..e2fa9b917 100644 --- a/ui/js/actions/user.js +++ b/ui/js/actions/user.js @@ -1,8 +1,9 @@ import * as types from "constants/action_types"; import lbryio from "lbryio"; import { setLocal } from "utils"; -import { doRewardList } from "actions/rewards"; +import { doRewardList, doClaimRewardType } from "actions/rewards"; import { selectEmailToVerify, selectUser } from "selectors/user"; +import rewards from "rewards"; export function doAuthenticate() { return function(dispatch, getState) { @@ -152,6 +153,7 @@ export function doUserIdentityVerify(stripeToken) { type: types.USER_IDENTITY_VERIFY_SUCCESS, data: { user }, }); + dispatch(doClaimRewardType(rewards.TYPE_NEW_USER)); } else { throw new Error( "Your identity is still not verified. This should not happen." @@ -159,18 +161,6 @@ export function doUserIdentityVerify(stripeToken) { } }) .catch(error => { - // let user = selectUser(getState()); - // user.is_identity_verified = true; - // if (user.is_identity_verified) { - // dispatch({ - // type: types.USER_IDENTITY_VERIFY_SUCCESS, - // data: { user }, - // }); - // } else { - // throw new Error( - // "Your identity is still not verified. This should not happen." - // ); //shouldn't happen - // } dispatch({ type: types.USER_IDENTITY_VERIFY_FAILURE, data: { error: error.toString() }, diff --git a/ui/js/component/app/view.jsx b/ui/js/component/app/view.jsx index 5447580af..e364c0db0 100644 --- a/ui/js/component/app/view.jsx +++ b/ui/js/component/app/view.jsx @@ -6,6 +6,7 @@ import ModalDownloading from "component/modalDownloading"; import ModalInsufficientCredits from "component/modalInsufficientCredits"; import ModalUpgrade from "component/modalUpgrade"; import ModalWelcome from "component/modalWelcome"; +import ModalFirstReward from "component/modalFirstReward"; import lbry from "lbry"; import * as modals from "constants/modal_types"; @@ -72,6 +73,7 @@ class App extends React.PureComponent { {modal == modals.ERROR && } {modal == modals.INSUFFICIENT_CREDITS && } {modal == modals.WELCOME && } + {modal == modals.FIRST_REWARD && } ); } diff --git a/ui/js/component/modalFirstReward/index.js b/ui/js/component/modalFirstReward/index.js new file mode 100644 index 000000000..5993a990e --- /dev/null +++ b/ui/js/component/modalFirstReward/index.js @@ -0,0 +1,20 @@ +import React from "react"; +import rewards from "rewards"; +import { connect } from "react-redux"; +import { doCloseModal } from "actions/app"; +import { makeSelectRewardByType } from "selectors/rewards"; +import ModalFirstReward from "./view"; + +const select = (state, props) => { + const selectReward = makeSelectRewardByType(); + + return { + reward: selectReward(state, { reward_type: rewards.TYPE_NEW_USER }), + }; +}; + +const perform = dispatch => ({ + closeModal: () => dispatch(doCloseModal()), +}); + +export default connect(select, perform)(ModalFirstReward); diff --git a/ui/js/component/modalFirstReward/view.jsx b/ui/js/component/modalFirstReward/view.jsx new file mode 100644 index 000000000..fc0aead0f --- /dev/null +++ b/ui/js/component/modalFirstReward/view.jsx @@ -0,0 +1,50 @@ +import React from "react"; +import { Modal } from "component/modal"; +import { CreditAmount } from "component/common"; + +class ModalFirstReward extends React.PureComponent { + render() { + const { closeModal, reward } = this.props; + + return ( + +
+

{__("About Your Reward")}

+

+ {__("You earned a reward of")} + {" "} + {" "}{__("LBRY credits, or")} {__("LBC")}. +

+

+ {__( + "This reward will show in your Wallet momentarily, shown in the top right, probably while you are reading this message." + )} +

+

+ {__( + "LBC is used to compensate creators, to publish, and to have say in how the network works." + )} +

+

+ {__( + "No need to understand it all just yet! Try watching or downloading something next." + )} +

+

+ {__( + "Finally, pleaseh know that LBRY is an early beta and that it earns the name." + )} +

+
+
+ ); + } +} + +export default ModalFirstReward; diff --git a/ui/js/component/modalWelcome/index.js b/ui/js/component/modalWelcome/index.js index 00a50c86b..4d8962a70 100644 --- a/ui/js/component/modalWelcome/index.js +++ b/ui/js/component/modalWelcome/index.js @@ -15,7 +15,6 @@ const select = (state, props) => { selectReward = makeSelectRewardByType(); return { - hasClaimed: selectHasClaimed(state, { reward_type: rewards.TYPE_NEW_USER }), isRewardApproved: selectUserIsRewardApproved(state), reward: selectReward(state, { reward_type: rewards.TYPE_NEW_USER }), }; diff --git a/ui/js/component/modalWelcome/view.jsx b/ui/js/component/modalWelcome/view.jsx index 3dec74cfa..c87df9da7 100644 --- a/ui/js/component/modalWelcome/view.jsx +++ b/ui/js/component/modalWelcome/view.jsx @@ -6,87 +6,45 @@ import RewardLink from "component/rewardLink"; class ModalWelcome extends React.PureComponent { render() { - const { - closeModal, - hasClaimed, - isRewardApproved, - reward, - verifyAccount, - } = this.props; + const { closeModal, isRewardApproved, reward, verifyAccount } = this.props; - return !hasClaimed - ? -
-

{__("Welcome to LBRY.")}

-

- {__( - "Using LBRY is like dating a centaur. Totally normal up top, and" - )} - {" "}{__("way different")} {__("underneath.")} -

-

{__("Up top, LBRY is similar to popular media sites.")}

-

- {__( - "Below, LBRY is controlled by users -- you -- via blockchain and decentralization." - )} -

-

- {__("Please have")} {" "} - {reward && - } - {!reward && {__("??")}} - {" "} {__("as a thank you for building content freedom.")} -

-
- {isRewardApproved && - } - {!isRewardApproved && - } - {!isRewardApproved && - } -
-
-
- : -
-

{__("About Your Reward")}

-

- {__("You earned a reward of")} - {" "} - {" "}{__("LBRY credits, or")} {__("LBC")}. -

-

- {__( - "This reward will show in your Wallet momentarily, probably while you are reading this message." - )} -

-

- {__( - "LBC is used to compensate creators, to publish, and to have say in how the network works." - )} -

-

- {__( - "No need to understand it all just yet! Try watching or downloading something next." - )} -

-

- {__( - "Finally, know that LBRY is an early beta and that it earns the name." - )} -

-
-
; + return ( + +
+

{__("Welcome to LBRY.")}

+

+ {__( + "Using LBRY is like dating a centaur. Totally normal up top, and" + )} + {" "}{__("way different")} {__("underneath.")} +

+

{__("Up top, LBRY is similar to popular media sites.")}

+

+ {__( + "Below, LBRY is controlled by users -- you -- via blockchain and decentralization." + )} +

+

+ {__("Please have")} {" "} + {reward && + } + {!reward && {__("??")}} + {" "} {__("as a thank you for building content freedom.")} +

+
+ {isRewardApproved && + } + {!isRewardApproved && + } + +
+
+
+ ); } } diff --git a/ui/js/constants/modal_types.js b/ui/js/constants/modal_types.js index 6befad274..13db30f3d 100644 --- a/ui/js/constants/modal_types.js +++ b/ui/js/constants/modal_types.js @@ -5,3 +5,4 @@ export const ERROR = "error"; export const INSUFFICIENT_CREDITS = "insufficient_credits"; export const UPGRADE = "upgrade"; export const WELCOME = "welcome"; +export const FIRST_REWARD = "first_reward"; diff --git a/ui/js/page/auth/view.jsx b/ui/js/page/auth/view.jsx index b43c7298c..fac6e13a0 100644 --- a/ui/js/page/auth/view.jsx +++ b/ui/js/page/auth/view.jsx @@ -76,7 +76,7 @@ export class AuthPage extends React.PureComponent {
{__( - "This information is disclosed only to LBRY, Inc. and not to the LBRY network. It is collected to provide communication and prevent abuse." + "This information is disclosed only to LBRY, Inc. and not to the LBRY network. It is optional and only collected to provide communication and prevent abuse. You may use LBRY without providing this information." )}
diff --git a/ui/js/page/rewards/view.jsx b/ui/js/page/rewards/view.jsx index abb7a3879..f69f3c61b 100644 --- a/ui/js/page/rewards/view.jsx +++ b/ui/js/page/rewards/view.jsx @@ -97,11 +97,16 @@ class RewardsPage extends React.PureComponent { {" "} {__("This can take anywhere from several minutes to several days.")}

+

- {__("You will receive an email when this process is complete.")} + {__( + "We apologize for this inconvenience, but have added this additional step to prevent fraud." + )}

- {__("Please enjoy free content in the meantime!")} + {__("You will receive an email when this process is complete.") + + " " + + __("Please enjoy free content in the meantime!")}