remove invites and rewards

This commit is contained in:
zeppi 2021-12-08 17:48:02 -05:00 committed by jessopb
parent faa21cb681
commit 5e09de5f94
17 changed files with 146 additions and 235 deletions

View file

@ -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.", "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", "Sending": "Sending",
"You sent %lbc%": "You sent %lbc%", "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--" "--end--": "--end--"
} }

View file

@ -15,7 +15,7 @@ import { selectBalance } from 'redux/selectors/wallet';
import { doUpdateChannel, doCreateChannel, doClearChannelErrors } from 'redux/actions/claims'; import { doUpdateChannel, doCreateChannel, doClearChannelErrors } from 'redux/actions/claims';
import { doOpenModal } from 'redux/actions/app'; import { doOpenModal } from 'redux/actions/app';
import { doUpdateBlockListForPublishedChannel } from 'redux/actions/comments'; 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 { selectIsClaimingInitialRewards, selectHasClaimedInitialRewards } from 'redux/selectors/rewards';
import ChannelForm from './view'; import ChannelForm from './view';

View file

@ -11,6 +11,7 @@ import { doSignOut, doOpenModal } from 'redux/actions/app';
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings'; import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
import { selectHasNavigated, selectActiveChannelClaim } from 'redux/selectors/app'; import { selectHasNavigated, selectActiveChannelClaim } from 'redux/selectors/app';
import Header from './view'; import Header from './view';
import { selectMyChannelClaims } from 'redux/selectors/claims';
const select = (state) => ({ const select = (state) => ({
language: selectLanguage(state), language: selectLanguage(state),
@ -27,6 +28,7 @@ const select = (state) => ({
hasNavigated: selectHasNavigated(state), hasNavigated: selectHasNavigated(state),
user: selectUser(state), user: selectUser(state),
activeChannelClaim: selectActiveChannelClaim(state), activeChannelClaim: selectActiveChannelClaim(state),
myChannels: selectMyChannelClaims(state),
}); });
const perform = (dispatch) => ({ const perform = (dispatch) => ({

View file

@ -63,6 +63,7 @@ type Props = {
isAbsoluteSideNavHidden: boolean, isAbsoluteSideNavHidden: boolean,
hideCancel: boolean, hideCancel: boolean,
activeChannelClaim: ?ChannelClaim, activeChannelClaim: ?ChannelClaim,
myChannels: ?Array<ChannelClaim>,
}; };
const Header = (props: Props) => { const Header = (props: Props) => {
@ -91,6 +92,7 @@ const Header = (props: Props) => {
hideCancel, hideCancel,
user, user,
activeChannelClaim, activeChannelClaim,
myChannels,
} = props; } = props;
const isMobile = useIsMobile(); const isMobile = useIsMobile();
// on the verify page don't let anyone escape other than by closing the tab to keep session data consistent // 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 { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui);
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url; 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 // Sign out if they click the "x" when they are on the password prompt
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' }; const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
@ -323,19 +326,12 @@ const Header = (props: Props) => {
<Icon aria-hidden icon={ICONS.CHANNEL} /> <Icon aria-hidden icon={ICONS.CHANNEL} />
{__('Channels')} {__('Channels')}
</MenuItem> </MenuItem>
{hasChannels && (
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.CREATOR_DASHBOARD}`)}> <MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.CREATOR_DASHBOARD}`)}>
<Icon aria-hidden icon={ICONS.ANALYTICS} /> <Icon aria-hidden icon={ICONS.ANALYTICS} />
{__('Creator Analytics')} {__('Creator Analytics')}
</MenuItem> </MenuItem>
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.REWARDS}`)}> )}
<Icon aria-hidden icon={ICONS.REWARDS} />
{__('Rewards')}
</MenuItem>
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.INVITE}`)}>
<Icon aria-hidden icon={ICONS.INVITE} />
{__('Invites')}
</MenuItem>
{authenticated ? ( {authenticated ? (
<MenuItem onSelect={IS_WEB ? signOut : openSignOutModal}> <MenuItem onSelect={IS_WEB ? signOut : openSignOutModal}>
<div className="menu__link"> <div className="menu__link">

View file

@ -6,7 +6,7 @@ import {
selectUserInviteReferralLink, selectUserInviteReferralLink,
selectUserInviteReferralCode, selectUserInviteReferralCode,
} from 'redux/selectors/user'; } from 'redux/selectors/user';
import { doUserInviteNew } from 'redux/actions/user'; // import { doUserInviteNew } from 'redux/actions/user';
import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims'; import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims';
import { doFetchChannelListMine } from 'redux/actions/claims'; import { doFetchChannelListMine } from 'redux/actions/claims';
import InviteNew from './view'; import InviteNew from './view';
@ -22,7 +22,7 @@ const select = (state) => ({
}); });
const perform = (dispatch) => ({ const perform = (dispatch) => ({
inviteNew: (email) => dispatch(doUserInviteNew(email)), // inviteNew: (email) => dispatch(doUserInviteNew(email)),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()), fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
}); });

View file

@ -1,5 +1,4 @@
// @flow // @flow
import * as PAGES from 'constants/pages';
import * as ICONS from 'constants/icons'; import * as ICONS from 'constants/icons';
import { RULE } from 'constants/notifications'; import { RULE } from 'constants/notifications';
import React from 'react'; import React from 'react';
@ -49,14 +48,6 @@ export default function Notification(props: Props) {
let notificationTarget; let notificationTarget;
switch (notification_rule) { 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: default:
notificationTarget = notification_parameters.device.target; notificationTarget = notification_parameters.device.target;
} }
@ -87,12 +78,6 @@ export default function Notification(props: Props) {
channelUrl = notification_parameters.dynamic.channel_url; channelUrl = notification_parameters.dynamic.channel_url;
icon = creatorIcon(channelUrl); icon = creatorIcon(channelUrl);
break; break;
case RULE.DAILY_WATCH_AVAILABLE:
case RULE.DAILY_WATCH_REMIND:
case RULE.MISSED_OUT:
case RULE.REWARDS_APPROVAL_PROMPT:
icon = <Icon icon={ICONS.LBC} sectionIcon />;
break;
case RULE.FIAT_TIP: case RULE.FIAT_TIP:
icon = <Icon icon={ICONS.FINANCE} sectionIcon />; icon = <Icon icon={ICONS.FINANCE} sectionIcon />;
break; break;

View file

@ -6,7 +6,7 @@ import * as PAGES from 'constants/pages';
import { PAGE_TITLE } from 'constants/pageTitles'; import { PAGE_TITLE } from 'constants/pageTitles';
import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment'; import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment';
import { parseURI, isURIValid } from 'util/lbryURI'; import { parseURI, isURIValid } from 'util/lbryURI';
import { SITE_TITLE, WELCOME_VERSION } from 'config'; import { WELCOME_VERSION } from 'config';
import { GetLinksData } from 'util/buildHomepage'; import { GetLinksData } from 'util/buildHomepage';
import HomePage from 'page/home'; import HomePage from 'page/home';
@ -23,7 +23,6 @@ import SignInVerifyPage from 'page/signInVerify';
import BuyPage from 'page/buy'; import BuyPage from 'page/buy';
import ReceivePage from 'page/receive'; import ReceivePage from 'page/receive';
import SendPage from 'page/send'; import SendPage from 'page/send';
import SwapPage from 'page/swap';
import WalletPage from 'page/wallet'; import WalletPage from 'page/wallet';
// Chunk: none // Chunk: none
@ -39,8 +38,6 @@ import DiscoverPage from 'page/discover';
import FileListPublished from 'page/fileListPublished'; import FileListPublished from 'page/fileListPublished';
import FourOhFourPage from 'page/fourOhFour'; import FourOhFourPage from 'page/fourOhFour';
import HelpPage from 'page/help'; import HelpPage from 'page/help';
import InvitePage from 'page/invite';
import InvitedPage from 'page/invited';
import LibraryPage from 'page/library'; import LibraryPage from 'page/library';
import ListBlockedPage from 'page/listBlocked'; import ListBlockedPage from 'page/listBlocked';
import ListsPage from 'page/lists'; import ListsPage from 'page/lists';
@ -52,8 +49,6 @@ import PublishPage from 'page/publish';
import ReportContentPage from 'page/reportContent'; import ReportContentPage from 'page/reportContent';
import ReportPage from 'page/report'; import ReportPage from 'page/report';
import RepostNew from 'page/repost'; import RepostNew from 'page/repost';
import RewardsPage from 'page/rewards';
import RewardsVerifyPage from 'page/rewardsVerify';
import SearchPage from 'page/search'; import SearchPage from 'page/search';
import SettingsCreatorPage from 'page/settingsCreator'; import SettingsCreatorPage from 'page/settingsCreator';
@ -67,7 +62,6 @@ import TagsFollowingPage from 'page/tagsFollowing';
import TopPage from 'page/top'; import TopPage from 'page/top';
import UpdatePasswordPage from 'page/passwordUpdate'; import UpdatePasswordPage from 'page/passwordUpdate';
import Welcome from 'page/welcome'; import Welcome from 'page/welcome';
import YoutubeSyncPage from 'page/youtubeSync';
// Tell the browser we are handling scroll restoration // Tell the browser we are handling scroll restoration
if ('scrollRestoration' in history) { if ('scrollRestoration' in history) {
@ -175,7 +169,7 @@ function AppRouter(props: Props) {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
return uri || pathname || title; return uri || pathname || title;
} }
return __(title) || (IS_WEB ? SITE_TITLE : 'LBRY'); return __(title) || 'LBRY';
}; };
if (uri) { if (uri) {
@ -260,11 +254,9 @@ function AppRouter(props: Props) {
<Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} /> <Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} />
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} /> <Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} /> <Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
<Route path={`/$/${PAGES.REPORT_CONTENT}`} exact component={ReportContentPage} /> <Route path={`/$/${PAGES.REPORT_CONTENT}`} exact component={ReportContentPage} />
<Route {...props} path={`/$/${PAGES.LIST}/:collectionId`} component={CollectionPage} /> <Route {...props} path={`/$/${PAGES.LIST}/:collectionId`} component={CollectionPage} />
<PrivateRoute {...props} exact path={`/$/${PAGES.YOUTUBE_SYNC}`} component={YoutubeSyncPage} />
<PrivateRoute {...props} exact path={`/$/${PAGES.TAGS_FOLLOWING}`} component={TagsFollowingPage} /> <PrivateRoute {...props} exact path={`/$/${PAGES.TAGS_FOLLOWING}`} component={TagsFollowingPage} />
<PrivateRoute <PrivateRoute
{...props} {...props}
@ -280,15 +272,12 @@ function AppRouter(props: Props) {
path={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`} path={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
component={ChannelsFollowingDiscoverPage} component={ChannelsFollowingDiscoverPage}
/> />
<PrivateRoute {...props} path={`/$/${PAGES.INVITE}`} component={InvitePage} />
<PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} /> <PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} />
<PrivateRoute {...props} path={`/$/${PAGES.REPOST_NEW}`} component={RepostNew} /> <PrivateRoute {...props} path={`/$/${PAGES.REPOST_NEW}`} component={RepostNew} />
<PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} /> <PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} />
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} /> <PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
<PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} /> <PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REPORT}`} component={ReportPage} /> <PrivateRoute {...props} path={`/$/${PAGES.REPORT}`} component={ReportPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS}`} exact component={RewardsPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS_VERIFY}`} component={RewardsVerifyPage} />
<PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} /> <PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} />
<PrivateRoute {...props} path={`/$/${PAGES.LISTS}`} component={ListsPage} /> <PrivateRoute {...props} path={`/$/${PAGES.LISTS}`} component={ListsPage} />
<PrivateRoute {...props} path={`/$/${PAGES.PLAYLISTS}`} component={PlaylistsPage} /> <PrivateRoute {...props} path={`/$/${PAGES.PLAYLISTS}`} component={PlaylistsPage} />
@ -300,7 +289,6 @@ function AppRouter(props: Props) {
<PrivateRoute {...props} path={`/$/${PAGES.BUY}`} component={BuyPage} /> <PrivateRoute {...props} path={`/$/${PAGES.BUY}`} component={BuyPage} />
<PrivateRoute {...props} path={`/$/${PAGES.RECEIVE}`} component={ReceivePage} /> <PrivateRoute {...props} path={`/$/${PAGES.RECEIVE}`} component={ReceivePage} />
<PrivateRoute {...props} path={`/$/${PAGES.SEND}`} component={SendPage} /> <PrivateRoute {...props} path={`/$/${PAGES.SEND}`} component={SendPage} />
<PrivateRoute {...props} path={`/$/${PAGES.SWAP}`} component={SwapPage} />
<PrivateRoute {...props} path={`/$/${PAGES.NOTIFICATIONS}`} component={NotificationsPage} /> <PrivateRoute {...props} path={`/$/${PAGES.NOTIFICATIONS}`} component={NotificationsPage} />
<PrivateRoute {...props} path={`/$/${PAGES.AUTH_WALLET_PASSWORD}`} component={SignInWalletPasswordPage} /> <PrivateRoute {...props} path={`/$/${PAGES.AUTH_WALLET_PASSWORD}`} component={SignInWalletPasswordPage} />
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_OWN_COMMENTS}`} component={OwnComments} /> <PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_OWN_COMMENTS}`} component={OwnComments} />

View file

@ -38,8 +38,7 @@ export default function YrblHelp(props: Props) {
} }
actions={ actions={
<div className="section__actions"> <div className="section__actions">
<Button button="primary" icon={ICONS.REWARDS} label={__('Earn Rewards')} navigate={`/$/${PAGES.REWARDS}`} /> <Button button="secondary" icon={ICONS.BUY} label={'Buy Credits'} navigate={`/$/${PAGES.BUY}`} />
<Button button="secondary" icon={ICONS.BUY} label={'Buy/Swap Credits'} navigate={`/$/${PAGES.BUY}`} />
{includeWalletLink && ( {includeWalletLink && (
<Button <Button
icon={ICONS.RECEIVE} icon={ICONS.RECEIVE}

View file

@ -1,5 +1,4 @@
// @flow // @flow
import * as ICONS from 'constants/icons';
import React from 'react'; import React from 'react';
import Page from 'component/page'; import Page from 'component/page';
import Card from 'component/common/card'; import Card from 'component/common/card';
@ -14,8 +13,6 @@ import Button from 'component/button';
import Nag from 'component/common/nag'; import Nag from 'component/common/nag';
import I18nMessage from 'component/i18nMessage'; import I18nMessage from 'component/i18nMessage';
import LbcSymbol from 'component/common/lbc-symbol'; import LbcSymbol from 'component/common/lbc-symbol';
import classnames from 'classnames';
import WalletSwap from 'component/walletSwap';
const MOONPAY_KEY = process.env.MOONPAY_SECRET_KEY; const MOONPAY_KEY = process.env.MOONPAY_SECRET_KEY;
const COUNTRIES = Array.from( const COUNTRIES = Array.from(
@ -37,11 +34,6 @@ const COUNTRIES = Array.from(
) )
); );
const TAB = {
BUY: 'BUY',
SWAP: 'SWAP',
};
type Props = { type Props = {
receiveAddress: ?string, receiveAddress: ?string,
gettingNewAddress: boolean, gettingNewAddress: boolean,
@ -54,7 +46,6 @@ type Props = {
export default function BuyPage(props: Props) { export default function BuyPage(props: Props) {
const { receiveAddress, gettingNewAddress, doGetNewAddress, email, user, doUserSetCountry } = props; const { receiveAddress, gettingNewAddress, doGetNewAddress, email, user, doUserSetCountry } = props;
const initialCountry = (user && user.country) || ''; const initialCountry = (user && user.country) || '';
const [tab, setTab] = React.useState(TAB.BUY);
const [url, setUrl] = React.useState(); const [url, setUrl] = React.useState();
const [country, setCountry] = React.useState(initialCountry); const [country, setCountry] = React.useState(initialCountry);
const [showPurchaseScreen, setShowPurchaseScreen] = React.useState(false); const [showPurchaseScreen, setShowPurchaseScreen] = React.useState(false);
@ -107,30 +98,10 @@ export default function BuyPage(props: Props) {
className="main--swap" className="main--swap"
backout={{ backout={{
backoutLabel: __('Done'), backoutLabel: __('Done'),
title: <LbcSymbol prefix={__('Buy or Swap')} size={28} />, title: <LbcSymbol prefix={__('Buy LBC')} size={28} />,
}} }}
> >
<div className="section"> <div className="section">
<Button
key="tip"
icon={ICONS.BUY}
label={__('Buy')}
button="alt"
onClick={() => setTab(TAB.BUY)}
className={classnames('button-toggle', { 'button-toggle--active': tab === TAB.BUY })}
/>
<Button
key="boost"
icon={ICONS.COIN_SWAP}
label={__('Swap')}
button="alt"
onClick={() => setTab(TAB.SWAP)}
className={classnames('button-toggle', { 'button-toggle--active': tab === TAB.SWAP })}
/>
</div>
<div className="section">
{tab === TAB.SWAP && <WalletSwap />}
{tab === TAB.BUY && (
<> <>
{!user && ( {!user && (
<div className="main--empty"> <div className="main--empty">
@ -166,8 +137,7 @@ export default function BuyPage(props: Props) {
title={title} title={title}
subtitle={subtitle} subtitle={subtitle}
nag={ nag={
country && country && !isValid && <Nag relative type="helpful" message={"This country isn't supported yet."} />
!isValid && <Nag relative type="helpful" message={"This country isn't supported yet."} />
} }
actions={ actions={
<div> <div>
@ -221,7 +191,6 @@ export default function BuyPage(props: Props) {
</> </>
)} )}
</> </>
)}
</div> </div>
</Page> </Page>
); );

View file

@ -15,7 +15,7 @@ import ChannelContent from 'component/channelContent';
import ChannelAbout from 'component/channelAbout'; import ChannelAbout from 'component/channelAbout';
import ChannelDiscussion from 'component/channelDiscussion'; import ChannelDiscussion from 'component/channelDiscussion';
import ChannelThumbnail from 'component/channelThumbnail'; import ChannelThumbnail from 'component/channelThumbnail';
import ChannelEdit from 'component/channelEdit'; import ChannelForm from 'component/channelForm';
import classnames from 'classnames'; import classnames from 'classnames';
import HelpLink from 'component/common/help-link'; import HelpLink from 'component/common/help-link';
import ClaimSupportButton from 'component/claimSupportButton'; import ClaimSupportButton from 'component/claimSupportButton';
@ -202,7 +202,7 @@ function ChannelPage(props: Props) {
simpleTitle: __('Editing'), simpleTitle: __('Editing'),
}} }}
> >
<ChannelEdit uri={uri} onDone={() => goBack()} /> <ChannelForm uri={uri} onDone={() => goBack()} />
</Page> </Page>
); );
} }

View file

@ -1,7 +1,7 @@
// @flow // @flow
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
import React from 'react'; import React from 'react';
import ChannelEdit from 'component/channelEdit'; import ChannelForm from 'component/channelForm';
import Page from 'component/page'; import Page from 'component/page';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import YrblWalletEmpty from 'component/yrblWalletEmpty'; import YrblWalletEmpty from 'component/yrblWalletEmpty';
@ -29,7 +29,7 @@ function ChannelNew(props: Props) {
<Page noSideNavigation noFooter backout={{ title: __('Create a channel'), backLabel: __('Cancel') }}> <Page noSideNavigation noFooter backout={{ title: __('Create a channel'), backLabel: __('Cancel') }}>
{emptyBalance && <YrblWalletEmpty />} {emptyBalance && <YrblWalletEmpty />}
<ChannelEdit <ChannelForm
disabled={emptyBalance} disabled={emptyBalance}
onDone={() => { onDone={() => {
push(redirectUrl || `/$/${PAGES.CHANNELS}`); push(redirectUrl || `/$/${PAGES.CHANNELS}`);

View file

@ -5,7 +5,7 @@ import {
selectUserInviteStatusIsPending, selectUserInviteStatusIsPending,
selectUserVerifiedEmail, selectUserVerifiedEmail,
} from 'redux/selectors/user'; } from 'redux/selectors/user';
import { doFetchInviteStatus } from 'redux/actions/user'; // import { doFetchInviteStatus } from 'redux/actions/user';
import { makeSelectClientSetting } from 'redux/selectors/settings'; import { makeSelectClientSetting } from 'redux/selectors/settings';
import { doSetClientSetting } from 'redux/actions/settings'; import { doSetClientSetting } from 'redux/actions/settings';
import InvitePage from './view'; import InvitePage from './view';
@ -18,7 +18,7 @@ const select = (state) => ({
}); });
const perform = (dispatch) => ({ const perform = (dispatch) => ({
fetchInviteStatus: () => dispatch(doFetchInviteStatus()), // fetchInviteStatus: () => dispatch(doFetchInviteStatus()),
acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)), acknowledgeInivte: () => dispatch(doSetClientSetting(SETTINGS.INVITE_ACKNOWLEDGED, true)),
}); });

View file

@ -1,6 +0,0 @@
import { connect } from 'react-redux';
import SwapPage from './view';
const select = (state) => ({});
export default connect(select, null)(SwapPage);

View file

@ -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 (
<Page
noSideNavigation
className="main--swap"
backout={{
backoutLabel: __('Done'),
title: __('Swap Crypto'),
}}
>
<WalletSwap />
</Page>
);
}

View file

@ -4,7 +4,7 @@ import { doToast } from 'redux/actions/notifications';
import * as ACTIONS from 'constants/action_types'; import * as ACTIONS from 'constants/action_types';
import { selectUnclaimedRewards } from 'redux/selectors/rewards'; import { selectUnclaimedRewards } from 'redux/selectors/rewards';
import { selectUserIsRewardApproved } from 'redux/selectors/user'; import { selectUserIsRewardApproved } from 'redux/selectors/user';
import { doFetchInviteStatus } from 'redux/actions/user'; // import { doFetchInviteStatus } from 'redux/actions/user';
import rewards from 'rewards'; import rewards from 'rewards';
export function doRewardList() { export function doRewardList() {
@ -88,8 +88,6 @@ export function doClaimRewardType(rewardType, options = {}) {
}); });
if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) { if (successReward.reward_type === rewards.TYPE_NEW_USER && rewards.callbacks.claimFirstRewardSuccess) {
rewards.callbacks.claimFirstRewardSuccess(); rewards.callbacks.claimFirstRewardSuccess();
} else if (successReward.reward_type === rewards.TYPE_REFERRAL) {
dispatch(doFetchInviteStatus());
} }
dispatch(doRewardList()); dispatch(doRewardList());
@ -125,7 +123,6 @@ export function doClaimRewardType(rewardType, options = {}) {
export function doClaimInitialRewards() { export function doClaimInitialRewards() {
return (dispatch) => { return (dispatch) => {
dispatch(doClaimRewardType(rewards.TYPE_NEW_USER));
dispatch(doClaimRewardType(rewards.TYPE_CONFIRM_EMAIL)); dispatch(doClaimRewardType(rewards.TYPE_CONFIRM_EMAIL));
}; };
} }

View file

@ -7,7 +7,6 @@ import { batchActions } from 'util/batch-actions';
import * as ACTIONS from 'constants/action_types'; import * as ACTIONS from 'constants/action_types';
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards'; import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
import { selectEmailToVerify, selectPhoneToVerify, selectUserCountryCode, selectUser } from 'redux/selectors/user'; import { selectEmailToVerify, selectPhoneToVerify, selectUserCountryCode, selectUser } from 'redux/selectors/user';
import { doToast } from 'redux/actions/notifications';
import rewards from 'rewards'; import rewards from 'rewards';
import { Lbryio } from 'lbryinc'; import { Lbryio } from 'lbryinc';
import { DOMAIN } from 'config'; import { DOMAIN } from 'config';
@ -156,7 +155,6 @@ export function doAuthenticate(
if (shareUsageData) { if (shareUsageData) {
dispatch(doRewardList()); dispatch(doRewardList());
dispatch(doFetchInviteStatus(false));
if (callInstall) { if (callInstall) {
doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData, domain); doInstallNew(appVersion, os, firebaseToken, callbackForUsersWhoAreSharingData, domain);
} }
@ -642,36 +640,37 @@ export function doUserIdentityVerify(stripeToken) {
}; };
} }
export function doUserInviteNew(email) { // rid of this
return (dispatch) => { // export function doUserInviteNew(email) {
dispatch({ // return (dispatch) => {
type: ACTIONS.USER_INVITE_NEW_STARTED, // dispatch({
}); // type: ACTIONS.USER_INVITE_NEW_STARTED,
// });
return Lbryio.call('user', 'invite', { email }, 'post') //
.then((success) => { // return Lbryio.call('user', 'invite', { email }, 'post')
dispatch({ // .then((success) => {
type: ACTIONS.USER_INVITE_NEW_SUCCESS, // dispatch({
data: { email }, // type: ACTIONS.USER_INVITE_NEW_SUCCESS,
}); // data: { email },
// });
dispatch( //
doToast({ // dispatch(
message: __('Invite sent to %email_address%', { email_address: email }), // doToast({
}) // message: __('Invite sent to %email_address%', { email_address: email }),
); // })
// );
dispatch(doFetchInviteStatus()); //
return success; // dispatch(doFetchInviteStatus());
}) // return success;
.catch((error) => { // })
dispatch({ // .catch((error) => {
type: ACTIONS.USER_INVITE_NEW_FAILURE, // dispatch({
data: { error }, // type: ACTIONS.USER_INVITE_NEW_FAILURE,
}); // data: { error },
}); // });
}; // });
} // };
// }
export function doUserSetReferrerReset() { export function doUserSetReferrerReset() {
return (dispatch) => { return (dispatch) => {