From 5e09de5f9433fd8a8dd32e9e00fe3ea05ff93001 Mon Sep 17 00:00:00 2001 From: zeppi Date: Wed, 8 Dec 2021 17:48:02 -0500 Subject: [PATCH] remove invites and rewards --- static/app-strings.json | 3 + .../{channelEdit => channelForm}/index.js | 2 +- .../{channelEdit => channelForm}/view.jsx | 0 ui/component/header/index.js | 2 + ui/component/header/view.jsx | 22 +- ui/component/inviteNew/index.js | 4 +- ui/component/notification/view.jsx | 15 -- ui/component/router/view.jsx | 16 +- ui/component/yrblWalletEmpty/view.jsx | 3 +- ui/page/buy/view.jsx | 207 ++++++++---------- ui/page/channel/view.jsx | 4 +- ui/page/channelNew/view.jsx | 4 +- ui/page/invite/index.js | 4 +- ui/page/swap/index.js | 6 - ui/page/swap/view.jsx | 21 -- ui/redux/actions/rewards.js | 5 +- ui/redux/actions/user.js | 63 +++--- 17 files changed, 146 insertions(+), 235 deletions(-) rename ui/component/{channelEdit => channelForm}/index.js (97%) rename ui/component/{channelEdit => channelForm}/view.jsx (100%) delete mode 100644 ui/page/swap/index.js delete mode 100644 ui/page/swap/view.jsx diff --git a/static/app-strings.json b/static/app-strings.json index b3527b9b3..2519ea806 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2222,5 +2222,8 @@ "Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.": "Your wallet is not currently using a cloud sync service. You are in control of backing up your wallet.", "Sending": "Sending", "You sent %lbc%": "You sent %lbc%", + "Buy LBC": "Buy LBC", + "This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)": "This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)", + "Use official LBRY wallet servers": "Use official LBRY wallet servers", "--end--": "--end--" } diff --git a/ui/component/channelEdit/index.js b/ui/component/channelForm/index.js similarity index 97% rename from ui/component/channelEdit/index.js rename to ui/component/channelForm/index.js index 43e054f7e..ae2f83119 100644 --- a/ui/component/channelEdit/index.js +++ b/ui/component/channelForm/index.js @@ -15,7 +15,7 @@ import { selectBalance } from 'redux/selectors/wallet'; import { doUpdateChannel, doCreateChannel, doClearChannelErrors } from 'redux/actions/claims'; import { doOpenModal } from 'redux/actions/app'; import { doUpdateBlockListForPublishedChannel } from 'redux/actions/comments'; -import { doClaimInitialRewards } from 'redux/actions/rewards'; +import { doClaimInitialRewards } from 'redux/actions/rewards'; // why import { selectIsClaimingInitialRewards, selectHasClaimedInitialRewards } from 'redux/selectors/rewards'; import ChannelForm from './view'; diff --git a/ui/component/channelEdit/view.jsx b/ui/component/channelForm/view.jsx similarity index 100% rename from ui/component/channelEdit/view.jsx rename to ui/component/channelForm/view.jsx diff --git a/ui/component/header/index.js b/ui/component/header/index.js index 1584630d3..a320ff346 100644 --- a/ui/component/header/index.js +++ b/ui/component/header/index.js @@ -11,6 +11,7 @@ import { doSignOut, doOpenModal } from 'redux/actions/app'; import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings'; import { selectHasNavigated, selectActiveChannelClaim } from 'redux/selectors/app'; import Header from './view'; +import { selectMyChannelClaims } from 'redux/selectors/claims'; const select = (state) => ({ language: selectLanguage(state), @@ -27,6 +28,7 @@ const select = (state) => ({ hasNavigated: selectHasNavigated(state), user: selectUser(state), activeChannelClaim: selectActiveChannelClaim(state), + myChannels: selectMyChannelClaims(state), }); const perform = (dispatch) => ({ diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx index 8d249aedd..2715fe630 100644 --- a/ui/component/header/view.jsx +++ b/ui/component/header/view.jsx @@ -63,6 +63,7 @@ type Props = { isAbsoluteSideNavHidden: boolean, hideCancel: boolean, activeChannelClaim: ?ChannelClaim, + myChannels: ?Array, }; const Header = (props: Props) => { @@ -91,6 +92,7 @@ const Header = (props: Props) => { hideCancel, user, activeChannelClaim, + myChannels, } = props; const isMobile = useIsMobile(); // on the verify page don't let anyone escape other than by closing the tab to keep session data consistent @@ -102,6 +104,7 @@ const Header = (props: Props) => { const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {}; const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url; + const hasChannels = myChannels && myChannels.length > 0; // Sign out if they click the "x" when they are on the password prompt const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' }; @@ -323,19 +326,12 @@ const Header = (props: Props) => { {__('Channels')} - history.push(`/$/${PAGES.CREATOR_DASHBOARD}`)}> - - {__('Creator Analytics')} - - history.push(`/$/${PAGES.REWARDS}`)}> - - {__('Rewards')} - - history.push(`/$/${PAGES.INVITE}`)}> - - {__('Invites')} - - + {hasChannels && ( + history.push(`/$/${PAGES.CREATOR_DASHBOARD}`)}> + + {__('Creator Analytics')} + + )} {authenticated ? (
diff --git a/ui/component/inviteNew/index.js b/ui/component/inviteNew/index.js index c5b72df8b..c7cbc0ada 100644 --- a/ui/component/inviteNew/index.js +++ b/ui/component/inviteNew/index.js @@ -6,7 +6,7 @@ import { selectUserInviteReferralLink, selectUserInviteReferralCode, } from 'redux/selectors/user'; -import { doUserInviteNew } from 'redux/actions/user'; +// import { doUserInviteNew } from 'redux/actions/user'; import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims'; import { doFetchChannelListMine } from 'redux/actions/claims'; import InviteNew from './view'; @@ -22,7 +22,7 @@ const select = (state) => ({ }); const perform = (dispatch) => ({ - inviteNew: (email) => dispatch(doUserInviteNew(email)), + // inviteNew: (email) => dispatch(doUserInviteNew(email)), fetchChannelListMine: () => dispatch(doFetchChannelListMine()), }); diff --git a/ui/component/notification/view.jsx b/ui/component/notification/view.jsx index a97bee087..0b94bd91e 100644 --- a/ui/component/notification/view.jsx +++ b/ui/component/notification/view.jsx @@ -1,5 +1,4 @@ // @flow -import * as PAGES from 'constants/pages'; import * as ICONS from 'constants/icons'; import { RULE } from 'constants/notifications'; import React from 'react'; @@ -49,14 +48,6 @@ export default function Notification(props: Props) { let notificationTarget; switch (notification_rule) { - case RULE.DAILY_WATCH_AVAILABLE: - case RULE.DAILY_WATCH_REMIND: - notificationTarget = `/$/${PAGES.CHANNELS_FOLLOWING}`; - break; - case RULE.MISSED_OUT: - case RULE.REWARDS_APPROVAL_PROMPT: - notificationTarget = `/$/${PAGES.REWARDS_VERIFY}?redirect=/$/${PAGES.REWARDS}`; - break; default: notificationTarget = notification_parameters.device.target; } @@ -87,12 +78,6 @@ export default function Notification(props: Props) { channelUrl = notification_parameters.dynamic.channel_url; icon = creatorIcon(channelUrl); break; - case RULE.DAILY_WATCH_AVAILABLE: - case RULE.DAILY_WATCH_REMIND: - case RULE.MISSED_OUT: - case RULE.REWARDS_APPROVAL_PROMPT: - icon = ; - break; case RULE.FIAT_TIP: icon = ; break; diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index b77ca95b1..f19eb169c 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -6,7 +6,7 @@ import * as PAGES from 'constants/pages'; import { PAGE_TITLE } from 'constants/pageTitles'; import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment'; import { parseURI, isURIValid } from 'util/lbryURI'; -import { SITE_TITLE, WELCOME_VERSION } from 'config'; +import { WELCOME_VERSION } from 'config'; import { GetLinksData } from 'util/buildHomepage'; import HomePage from 'page/home'; @@ -23,7 +23,6 @@ import SignInVerifyPage from 'page/signInVerify'; import BuyPage from 'page/buy'; import ReceivePage from 'page/receive'; import SendPage from 'page/send'; -import SwapPage from 'page/swap'; import WalletPage from 'page/wallet'; // Chunk: none @@ -39,8 +38,6 @@ import DiscoverPage from 'page/discover'; import FileListPublished from 'page/fileListPublished'; import FourOhFourPage from 'page/fourOhFour'; import HelpPage from 'page/help'; -import InvitePage from 'page/invite'; -import InvitedPage from 'page/invited'; import LibraryPage from 'page/library'; import ListBlockedPage from 'page/listBlocked'; import ListsPage from 'page/lists'; @@ -52,8 +49,6 @@ import PublishPage from 'page/publish'; import ReportContentPage from 'page/reportContent'; import ReportPage from 'page/report'; import RepostNew from 'page/repost'; -import RewardsPage from 'page/rewards'; -import RewardsVerifyPage from 'page/rewardsVerify'; import SearchPage from 'page/search'; import SettingsCreatorPage from 'page/settingsCreator'; @@ -67,7 +62,6 @@ import TagsFollowingPage from 'page/tagsFollowing'; import TopPage from 'page/top'; import UpdatePasswordPage from 'page/passwordUpdate'; import Welcome from 'page/welcome'; -import YoutubeSyncPage from 'page/youtubeSync'; // Tell the browser we are handling scroll restoration if ('scrollRestoration' in history) { @@ -175,7 +169,7 @@ function AppRouter(props: Props) { if (process.env.NODE_ENV !== 'production') { return uri || pathname || title; } - return __(title) || (IS_WEB ? SITE_TITLE : 'LBRY'); + return __(title) || 'LBRY'; }; if (uri) { @@ -260,11 +254,9 @@ function AppRouter(props: Props) { - - - - - @@ -300,7 +289,6 @@ function AppRouter(props: Props) { - diff --git a/ui/component/yrblWalletEmpty/view.jsx b/ui/component/yrblWalletEmpty/view.jsx index 65df8510e..37f3e2b6c 100644 --- a/ui/component/yrblWalletEmpty/view.jsx +++ b/ui/component/yrblWalletEmpty/view.jsx @@ -38,8 +38,7 @@ export default function YrblHelp(props: Props) { } actions={
-
-
- {tab === TAB.SWAP && } - {tab === TAB.BUY && ( - <> - {!user && ( -
- -
- )} + <> + {!user && ( +
+ +
+ )} - {user && ( - <> - {showPurchaseScreen ? ( - -

{__('Your browser does not support iframes.')}

- - ) : ( -
- -
- ) - } - /> - ) : ( - - } - actions={ -
-
- setCountry(e.target.value)} - > - - {COUNTRIES.map((country, index) => ( - - ))} - -
- {country && ( -
- {isValid ? ( -
-
- ) : ( -
-
- )} -
- )} + {user && ( + <> + {showPurchaseScreen ? ( + +

{__('Your browser does not support iframes.')}

+ + ) : ( +
+
- } - /> - )} - - )} - - )} + ) + } + /> + ) : ( + + } + actions={ +
+
+ setCountry(e.target.value)} + > + + {COUNTRIES.map((country, index) => ( + + ))} + +
+ {country && ( +
+ {isValid ? ( +
+
+ ) : ( +
+
+ )} +
+ )} +
+ } + /> + )} + + )} +
); diff --git a/ui/page/channel/view.jsx b/ui/page/channel/view.jsx index c20a264b9..efba3b151 100644 --- a/ui/page/channel/view.jsx +++ b/ui/page/channel/view.jsx @@ -15,7 +15,7 @@ import ChannelContent from 'component/channelContent'; import ChannelAbout from 'component/channelAbout'; import ChannelDiscussion from 'component/channelDiscussion'; import ChannelThumbnail from 'component/channelThumbnail'; -import ChannelEdit from 'component/channelEdit'; +import ChannelForm from 'component/channelForm'; import classnames from 'classnames'; import HelpLink from 'component/common/help-link'; import ClaimSupportButton from 'component/claimSupportButton'; @@ -202,7 +202,7 @@ function ChannelPage(props: Props) { simpleTitle: __('Editing'), }} > - goBack()} /> + goBack()} /> ); } diff --git a/ui/page/channelNew/view.jsx b/ui/page/channelNew/view.jsx index d29184498..6f93a0a40 100644 --- a/ui/page/channelNew/view.jsx +++ b/ui/page/channelNew/view.jsx @@ -1,7 +1,7 @@ // @flow import * as PAGES from 'constants/pages'; import React from 'react'; -import ChannelEdit from 'component/channelEdit'; +import ChannelForm from 'component/channelForm'; import Page from 'component/page'; import { useHistory } from 'react-router'; import YrblWalletEmpty from 'component/yrblWalletEmpty'; @@ -29,7 +29,7 @@ function ChannelNew(props: Props) { {emptyBalance && } - { push(redirectUrl || `/$/${PAGES.CHANNELS}`); diff --git a/ui/page/invite/index.js b/ui/page/invite/index.js index b563bcec8..44a45db3e 100644 --- a/ui/page/invite/index.js +++ b/ui/page/invite/index.js @@ -5,7 +5,7 @@ import { selectUserInviteStatusIsPending, selectUserVerifiedEmail, } from 'redux/selectors/user'; -import { doFetchInviteStatus } from 'redux/actions/user'; +// import { doFetchInviteStatus } from 'redux/actions/user'; import { makeSelectClientSetting } from 'redux/selectors/settings'; import { doSetClientSetting } from 'redux/actions/settings'; import InvitePage from './view'; @@ -18,7 +18,7 @@ const select = (state) => ({ }); const perform = (dispatch) => ({ - fetchInviteStatus: () => dispatch(doFetchInviteStatus()), + // fetchInviteStatus: () => dispatch(doFetchInviteStatus()), acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)), }); diff --git a/ui/page/swap/index.js b/ui/page/swap/index.js deleted file mode 100644 index 8d853b9cf..000000000 --- a/ui/page/swap/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { connect } from 'react-redux'; -import SwapPage from './view'; - -const select = (state) => ({}); - -export default connect(select, null)(SwapPage); diff --git a/ui/page/swap/view.jsx b/ui/page/swap/view.jsx deleted file mode 100644 index fe229a1b0..000000000 --- a/ui/page/swap/view.jsx +++ /dev/null @@ -1,21 +0,0 @@ -// @flow -import React from 'react'; -import Page from 'component/page'; -import WalletSwap from 'component/walletSwap'; - -type Props = {}; - -export default function SwapPage(props: Props) { - return ( - - - - ); -} diff --git a/ui/redux/actions/rewards.js b/ui/redux/actions/rewards.js index 7c2792ff0..7c5653a58 100644 --- a/ui/redux/actions/rewards.js +++ b/ui/redux/actions/rewards.js @@ -4,7 +4,7 @@ import { doToast } from 'redux/actions/notifications'; import * as ACTIONS from 'constants/action_types'; import { selectUnclaimedRewards } from 'redux/selectors/rewards'; import { selectUserIsRewardApproved } from 'redux/selectors/user'; -import { doFetchInviteStatus } from 'redux/actions/user'; +// import { doFetchInviteStatus } from 'redux/actions/user'; import rewards from 'rewards'; export function doRewardList() { @@ -88,8 +88,6 @@ export function doClaimRewardType(rewardType, options = {}) { }); if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) { rewards.callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards.TYPE_REFERRAL) { - dispatch(doFetchInviteStatus()); } dispatch(doRewardList()); @@ -125,7 +123,6 @@ export function doClaimRewardType(rewardType, options = {}) { export function doClaimInitialRewards() { return (dispatch) => { - dispatch(doClaimRewardType(rewards.TYPE_NEW_USER)); dispatch(doClaimRewardType(rewards.TYPE_CONFIRM_EMAIL)); }; } diff --git a/ui/redux/actions/user.js b/ui/redux/actions/user.js index 9ff3932e5..df9c1ff3d 100644 --- a/ui/redux/actions/user.js +++ b/ui/redux/actions/user.js @@ -7,7 +7,6 @@ import { batchActions } from 'util/batch-actions'; import * as ACTIONS from 'constants/action_types'; import { doClaimRewardType, doRewardList } from 'redux/actions/rewards'; import { selectEmailToVerify, selectPhoneToVerify, selectUserCountryCode, selectUser } from 'redux/selectors/user'; -import { doToast } from 'redux/actions/notifications'; import rewards from 'rewards'; import { Lbryio } from 'lbryinc'; import { DOMAIN } from 'config'; @@ -156,7 +155,6 @@ export function doAuthenticate( if (shareUsageData) { dispatch(doRewardList()); - dispatch(doFetchInviteStatus(false)); if (callInstall) { doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData, domain); } @@ -642,36 +640,37 @@ export function doUserIdentityVerify(stripeToken) { }; } -export function doUserInviteNew(email) { - return (dispatch) => { - dispatch({ - type: ACTIONS.USER_INVITE_NEW_STARTED, - }); - - return Lbryio.call('user', 'invite', { email }, 'post') - .then((success) => { - dispatch({ - type: ACTIONS.USER_INVITE_NEW_SUCCESS, - data: { email }, - }); - - dispatch( - doToast({ - message: __('Invite sent to %email_address%', { email_address: email }), - }) - ); - - dispatch(doFetchInviteStatus()); - return success; - }) - .catch((error) => { - dispatch({ - type: ACTIONS.USER_INVITE_NEW_FAILURE, - data: { error }, - }); - }); - }; -} +// rid of this +// export function doUserInviteNew(email) { +// return (dispatch) => { +// dispatch({ +// type: ACTIONS.USER_INVITE_NEW_STARTED, +// }); +// +// return Lbryio.call('user', 'invite', { email }, 'post') +// .then((success) => { +// dispatch({ +// type: ACTIONS.USER_INVITE_NEW_SUCCESS, +// data: { email }, +// }); +// +// dispatch( +// doToast({ +// message: __('Invite sent to %email_address%', { email_address: email }), +// }) +// ); +// +// dispatch(doFetchInviteStatus()); +// return success; +// }) +// .catch((error) => { +// dispatch({ +// type: ACTIONS.USER_INVITE_NEW_FAILURE, +// data: { error }, +// }); +// }); +// }; +// } export function doUserSetReferrerReset() { return (dispatch) => {