From 233477a2fa36e5d0d71579c0b38a03cbf11237bd Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 6 Aug 2021 15:43:21 +0800 Subject: [PATCH] [Account] grab stripe-related settings --- ui/component/settingAccount/index.js | 3 +- ui/component/settingAccount/view.jsx | 40 ++++++++++++++++++++++++++- ui/page/settings/index.js | 3 +- ui/page/settings/view.jsx | 41 ---------------------------- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/ui/component/settingAccount/index.js b/ui/component/settingAccount/index.js index 9abbe808b..596776c1f 100644 --- a/ui/component/settingAccount/index.js +++ b/ui/component/settingAccount/index.js @@ -1,11 +1,12 @@ import { connect } from 'react-redux'; import { doWalletStatus, selectWalletIsEncrypted } from 'lbry-redux'; -import { selectUserVerifiedEmail } from 'redux/selectors/user'; +import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user'; import SettingAccount from './view'; const select = (state) => ({ isAuthenticated: selectUserVerifiedEmail(state), walletEncrypted: selectWalletIsEncrypted(state), + user: selectUser(state), }); const perform = (dispatch) => ({ diff --git a/ui/component/settingAccount/view.jsx b/ui/component/settingAccount/view.jsx index 4097b532d..a1ea5a347 100644 --- a/ui/component/settingAccount/view.jsx +++ b/ui/component/settingAccount/view.jsx @@ -1,20 +1,26 @@ // @flow +import * as ICONS from 'constants/icons'; +import * as PAGES from 'constants/pages'; import React from 'react'; +import Button from 'component/button'; import Card from 'component/common/card'; import SettingAccountPassword from 'component/settingAccountPassword'; +import SettingsRow from 'component/settingsRow'; import SyncToggle from 'component/syncToggle'; import { getPasswordFromCookie } from 'util/saved-passwords'; +import { getStripeEnvironment } from 'util/stripe'; type Props = { // --- select --- isAuthenticated: boolean, walletEncrypted: boolean, + user: User, // --- perform --- doWalletStatus: () => void, }; export default function SettingAccount(props: Props) { - const { isAuthenticated, walletEncrypted, doWalletStatus } = props; + const { isAuthenticated, walletEncrypted, user, doWalletStatus } = props; const [storedPassword, setStoredPassword] = React.useState(false); // Determine if password is stored. @@ -48,6 +54,38 @@ export default function SettingAccount(props: Props) { {/* @endif */} + + {/* @if TARGET='web' */} + {user && getStripeEnvironment() && ( + +