mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-01 09:45:10 +00:00
add changelog add external service option to get credits page remove testing code fix user has existing email and grammar/typos
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
import React from "react";
|
|
import { connect } from "react-redux";
|
|
import { doCloseModal } from "redux/actions/app";
|
|
import { doNavigate } from "redux/actions/navigation";
|
|
import { doSetClientSetting } from "redux/actions/settings";
|
|
import { selectUserIsRewardApproved } from "redux/selectors/user";
|
|
import { selectBalance } from "redux/selectors/wallet";
|
|
import {
|
|
makeSelectHasClaimedReward,
|
|
makeSelectRewardByType,
|
|
selectUnclaimedRewardValue,
|
|
} from "redux/selectors/rewards";
|
|
import * as settings from "constants/settings";
|
|
import ModalCreditIntro from "./view";
|
|
|
|
const select = (state, props) => {
|
|
const selectHasClaimed = makeSelectHasClaimedReward(),
|
|
selectReward = makeSelectRewardByType();
|
|
|
|
return {
|
|
currentBalance: selectBalance(state),
|
|
isRewardApproved: selectUserIsRewardApproved(state),
|
|
totalRewardValue: selectUnclaimedRewardValue(state),
|
|
};
|
|
};
|
|
|
|
const perform = dispatch => () => {
|
|
return {
|
|
addBalance: () => {
|
|
dispatch(doSetClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED, true));
|
|
dispatch(doNavigate("/getcredits"));
|
|
dispatch(doCloseModal());
|
|
},
|
|
closeModal: () => {
|
|
dispatch(doSetClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED, true));
|
|
dispatch(doCloseModal());
|
|
},
|
|
};
|
|
};
|
|
|
|
export default connect(select, perform)(ModalCreditIntro);
|