fixes restoring wallet page and removing lbry.tv references

This commit is contained in:
zeppi 2021-11-28 15:05:10 -05:00 committed by jessopb
parent c6322ddb24
commit 1360e21016
16 changed files with 26 additions and 112 deletions

View file

@ -2219,5 +2219,6 @@
"Showing %filtered% results of %total%": "Showing %filtered% results of %total%", "Showing %filtered% results of %total%": "Showing %filtered% results of %total%",
"filtered": "filtered", "filtered": "filtered",
"View All Playlists": "View All Playlists", "View All Playlists": "View All Playlists",
"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.",
"--end--": "--end--" "--end--": "--end--"
} }

View file

@ -310,27 +310,18 @@ const analytics: Analytics = {
setUser: (userId) => { setUser: (userId) => {
if (internalAnalyticsEnabled && userId) { if (internalAnalyticsEnabled && userId) {
window._paq.push(['setUserId', String(userId)]); window._paq.push(['setUserId', String(userId)]);
// @if TARGET='app'
Native.getAppVersionInfo().then(({ localVersion }) => { Native.getAppVersionInfo().then(({ localVersion }) => {
sendMatomoEvent('Version', 'Desktop-Version', localVersion); sendMatomoEvent('Version', 'Desktop-Version', localVersion);
}); });
// @endif
} }
}, },
toggleInternal: (enabled: boolean): void => { toggleInternal: (enabled: boolean): void => {
// Always collect analytics on lbry.tv
// @if TARGET='app'
internalAnalyticsEnabled = enabled; internalAnalyticsEnabled = enabled;
window.localStorage.setItem(SHARE_INTERNAL, enabled); window.localStorage.setItem(SHARE_INTERNAL, enabled);
// @endif
}, },
toggleThirdParty: (enabled: boolean): void => { toggleThirdParty: (enabled: boolean): void => {
// Always collect analytics on lbry.tv
// @if TARGET='app'
// thirdPartyAnalyticsEnabled = enabled;
window.localStorage.setItem(SHARE_THIRD_PARTY, enabled); window.localStorage.setItem(SHARE_THIRD_PARTY, enabled);
// @endif
}, },
apiLogView: (uri, outpoint, claimId, timeToStart) => { apiLogView: (uri, outpoint, claimId, timeToStart) => {
@ -347,7 +338,6 @@ const analytics: Analytics = {
claim_id: claimId, claim_id: claimId,
}; };
// lbry.tv streams from AWS so we don't care about the time to start
if (timeToStart && !IS_WEB) { if (timeToStart && !IS_WEB) {
params.time_to_start = timeToStart; params.time_to_start = timeToStart;
} }

View file

@ -1,9 +1,7 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import FileDownloadLink from 'component/fileDownloadLink'; import FileDownloadLink from 'component/fileDownloadLink';
import * as RENDER_MODES from 'constants/file_render_modes';
import Card from 'component/common/card'; import Card from 'component/common/card';
import Button from 'component/button';
type Props = { type Props = {
uri: string, uri: string,
@ -11,30 +9,7 @@ type Props = {
}; };
export default function FileRenderDownload(props: Props) { export default function FileRenderDownload(props: Props) {
const { uri, renderMode } = props; const { uri } = props;
// @if TARGET='web'
if (RENDER_MODES.UNSUPPORTED_IN_THIS_APP.includes(renderMode)) {
return (
<Card
title={__('Download or get the app')}
subtitle={
<p>
{__(
'This content can be downloaded from lbry.tv, but not displayed. It will display in LBRY Desktop, an app for desktop computers.'
)}
</p>
}
actions={
<div className="section__actions">
<FileDownloadLink uri={uri} buttonType="primary" showLabel />
<Button button={'link'} label={__('Get the App')} href="https://lbry.com/get" />
</div>
}
/>
);
}
// @endif
return <Card title={__('Download')} actions={<FileDownloadLink uri={uri} buttonType="primary" showLabel />} />; return <Card title={__('Download')} actions={<FileDownloadLink uri={uri} buttonType="primary" showLabel />} />;
} }

View file

@ -14,11 +14,11 @@ const LIMITED = 'limited';
const NONE = 'none'; const NONE = 'none';
type Props = { type Props = {
setWelcomeVersion: number => void, setWelcomeVersion: (number) => void,
signOut: () => void, signOut: () => void,
setShareDataInternal: boolean => void, setShareDataInternal: (boolean) => void,
setShareDataThirdParty: boolean => void, setShareDataThirdParty: (boolean) => void,
history: { replace: string => void }, history: { replace: (string) => void },
authenticated: boolean, authenticated: boolean,
authenticateIfSharingData: () => void, authenticateIfSharingData: () => void,
}; };
@ -88,7 +88,7 @@ function PrivacyAgreement(props: Props) {
helper={__(`Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed helper={__(`Sending information to third parties (e.g. Google Analytics or Mixpanel) allows us to use detailed
analytical reports to improve all aspects of LBRY.`)} analytical reports to improve all aspects of LBRY.`)}
checked={share === FREE} checked={share === FREE}
onChange={e => setShare(FREE)} onChange={(e) => setShare(FREE)}
/> />
<FormField <FormField
name={'shareWithLBRY'} name={'shareWithLBRY'}
@ -103,7 +103,7 @@ function PrivacyAgreement(props: Props) {
`Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as `Sharing information with LBRY, Inc. allows us to report to publishers how their content is doing, as
well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.` well as track basic usage and performance. This is the minimum required to earn rewards from LBRY, Inc.`
)} )}
onChange={e => setShare(LIMITED)} onChange={(e) => setShare(LIMITED)}
/> />
<FormField <FormField
disabled={authenticated} disabled={authenticated}
@ -118,7 +118,7 @@ function PrivacyAgreement(props: Props) {
helper={__(`No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as helper={__(`No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as
peer-to-peer software, your IP address and potentially other system information can be sent to other peer-to-peer software, your IP address and potentially other system information can be sent to other
users, though this information is not stored permanently.`)} users, though this information is not stored permanently.`)}
onChange={e => setShare(NONE)} onChange={(e) => setShare(NONE)}
/> />
{authenticated && ( {authenticated && (
<div className="card--inline section--padded"> <div className="card--inline section--padded">
@ -128,7 +128,7 @@ function PrivacyAgreement(props: Props) {
signout_button: <Button button="link" label={__('Sign Out')} onClick={signOut} />, signout_button: <Button button="link" label={__('Sign Out')} onClick={signOut} />,
}} }}
> >
You are signed into lbry.tv which automatically shares data with LBRY inc. %signout_button%. You are signed in and sharing data with your cloud service provider. %signout_button%.
</I18nMessage> </I18nMessage>
</p> </p>
</div> </div>
@ -153,14 +153,14 @@ function PrivacyAgreement(props: Props) {
type="radio" type="radio"
label={'Yes'} label={'Yes'}
checked={agree === true} checked={agree === true}
onChange={e => setAgree(e.target.checked)} onChange={(e) => setAgree(e.target.checked)}
/> />
<FormField <FormField
name={'disagreeButton'} name={'disagreeButton'}
type="radio" type="radio"
checked={agree === false} checked={agree === false}
label={__('No')} label={__('No')}
onChange={e => setAgree(!e.target.checked)} onChange={(e) => setAgree(!e.target.checked)}
/> />
</fieldset> </fieldset>
</div> </div>

View file

@ -34,7 +34,6 @@ import ChannelsFollowingDiscoverPage from 'page/channelsFollowingDiscover';
import ChannelsFollowingPage from 'page/channelsFollowing'; import ChannelsFollowingPage from 'page/channelsFollowing';
import ChannelsPage from 'page/channels'; import ChannelsPage from 'page/channels';
import CheckoutPage from 'page/checkoutPage';
import CreatorDashboard from 'page/creatorDashboard'; import CreatorDashboard from 'page/creatorDashboard';
import DiscoverPage from 'page/discover'; import DiscoverPage from 'page/discover';
import FileListPublished from 'page/fileListPublished'; import FileListPublished from 'page/fileListPublished';
@ -224,9 +223,7 @@ function AppRouter(props: Props) {
return ( return (
<Switch> <Switch>
{/* @if TARGET='app' */}
{welcomeVersion < WELCOME_VERSION && <Route path="/*" component={Welcome} />} {welcomeVersion < WELCOME_VERSION && <Route path="/*" component={Welcome} />}
{/* @endif */}
<Redirect <Redirect
from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING_MANAGE}`} from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING_MANAGE}`}
to={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`} to={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
@ -264,7 +261,6 @@ function AppRouter(props: Props) {
<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.INVITE}/:referrer`} exact component={InvitedPage} />
<Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} />
<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} />

View file

@ -267,7 +267,7 @@ export default function SettingSystem(props: Props) {
subtitle={ subtitle={
<React.Fragment> <React.Fragment>
{__( {__(
`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 sign in to lbry.tv)` `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)`
)}{' '} )}{' '}
<Button button="link" label={__('Learn more')} href="https://lbry.com/privacypolicy" /> <Button button="link" label={__('Learn more')} href="https://lbry.com/privacypolicy" />
</React.Fragment> </React.Fragment>

View file

@ -114,7 +114,7 @@ function SettingWalletServer(props: Props) {
type="radio" type="radio"
name="default_wallet_servers" name="default_wallet_servers"
checked={!advancedMode} checked={!advancedMode}
label={__('Use official lbry.tv wallet servers')} label={__('Use official LBRY wallet servers')}
onChange={(e) => { onChange={(e) => {
if (e.target.checked) { if (e.target.checked) {
doClear(); doClear();

View file

@ -10,7 +10,7 @@ import Card from 'component/common/card';
type Props = { type Props = {
cancelButton: Node, cancelButton: Node,
email: string, email: string,
resendVerificationEmail: string => void, resendVerificationEmail: (string) => void,
checkEmailVerified: () => void, checkEmailVerified: () => void,
user: { user: {
has_verified_email: boolean, has_verified_email: boolean,
@ -35,12 +35,12 @@ function UserEmail(props: Props) {
return ( return (
<Card <Card
title={__('lbry.tv Account')} title={__('Cloud Account')}
subtitle={ subtitle={
isVerified isVerified
? undefined ? undefined
: __( : __(
'Creating a lbry.tv account will allow you to earn rewards, receive content and security updates, and optionally backup your data.' 'Connecting with a cloud account will allow you to earn rewards, receive content and security updates, and optionally backup your data.'
) )
} }
actions={ actions={

View file

@ -38,8 +38,6 @@ function UserEmailNew(props: Props) {
setShareDiagnosticData, setShareDiagnosticData,
clearEmailEntry, clearEmailEntry,
emailExists, emailExists,
interestedInYoutubSync,
doToggleInterestedInYoutubeSync,
} = props; } = props;
const { share_usage_data: shareUsageData } = daemonSettings; const { share_usage_data: shareUsageData } = daemonSettings;
const { push, location } = useHistory(); const { push, location } = useHistory();
@ -95,9 +93,7 @@ function UserEmailNew(props: Props) {
<div className={classnames('main__sign-up')}> <div className={classnames('main__sign-up')}>
<Card <Card
title={__('Cloud Connect')} title={__('Cloud Connect')}
// @if TARGET='app'
subtitle={__('Connect your wallet to Odysee')} subtitle={__('Connect your wallet to Odysee')}
// @endif
actions={ actions={
<div className={classnames({ 'card--disabled': DOMAIN === 'lbry.tv' && IS_WEB })}> <div className={classnames({ 'card--disabled': DOMAIN === 'lbry.tv' && IS_WEB })}>
<Form onSubmit={handleSubmit} className="section"> <Form onSubmit={handleSubmit} className="section">
@ -118,17 +114,6 @@ function UserEmailNew(props: Props) {
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
/> />
{/* @if TARGET='web' */}
<FormField
type="checkbox"
name="youtube_sync_checkbox"
label={__('Sync my YouTube channel')}
checked={interestedInYoutubSync}
onChange={() => doToggleInterestedInYoutubeSync()}
/>
{/* @endif */}
{/* @if TARGET='app' */}
<FormField <FormField
type="checkbox" type="checkbox"
name="sync_checkbox" name="sync_checkbox"
@ -141,7 +126,6 @@ function UserEmailNew(props: Props) {
checked={formSyncEnabled} checked={formSyncEnabled}
onChange={() => setFormSyncEnabled(!formSyncEnabled)} onChange={() => setFormSyncEnabled(!formSyncEnabled)}
/> />
{/* @endif */}
{!shareUsageData && !IS_WEB && ( {!shareUsageData && !IS_WEB && (
<FormField <FormField

View file

@ -138,19 +138,19 @@ const WalletBalance = (props: Props) => {
</div> </div>
)} )}
{/* @if TARGET='app' */}
{hasSynced ? ( {hasSynced ? (
<p className="section help"> <p className="section help">
{__('A backup of your wallet is synced with lbry.tv.')} {__('A backup of your wallet is synced with a cloud service.')}
<HelpLink href="https://lbry.com/faq/account-sync" /> <HelpLink href="https://lbry.com/faq/account-sync" />
</p> </p>
) : ( ) : (
<p className="help--warning"> <p className="help">
{__('Your wallet is not currently synced with lbry.tv. 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.'
)}
<HelpLink navigate={`/$/${PAGES.BACKUP}`} /> <HelpLink navigate={`/$/${PAGES.BACKUP}`} />
</p> </p>
)} )}
{/* @endif */}
<div className="section__actions"> <div className="section__actions">
<Button button="primary" label={__('Buy')} icon={ICONS.BUY} navigate={`/$/${PAGES.BUY}`} /> <Button button="primary" label={__('Buy')} icon={ICONS.BUY} navigate={`/$/${PAGES.BUY}`} />
<Button button="secondary" label={__('Receive')} icon={ICONS.RECEIVE} navigate={`/$/${PAGES.RECEIVE}`} /> <Button button="secondary" label={__('Receive')} icon={ICONS.RECEIVE} navigate={`/$/${PAGES.RECEIVE}`} />

View file

@ -1,2 +1,2 @@
export const ALREADY_CLAIMED = 'once the invite reward has been claimed the referrer cannot be changed'; export const ALREADY_CLAIMED = 'once the invite reward has been claimed the referrer cannot be changed';
export const REFERRER_NOT_FOUND = 'A lbry.tv account could not be found for the referrer you provided.'; export const REFERRER_NOT_FOUND = 'A LBRY account could not be found for the referrer you provided.';

View file

@ -66,7 +66,7 @@ class ModalSetReferrer extends React.PureComponent<Props, State> {
title={__('Enter inviter')} title={__('Enter inviter')}
subtitle={ subtitle={
<React.Fragment> <React.Fragment>
{__('Did someone invite you to use lbry.tv? Tell us who and you both get a reward!')} {__('Did someone invite you to use LBRY? Tell us who and you both get a reward!')}
<HelpLink href="https://lbry.com/faq/referrals" /> <HelpLink href="https://lbry.com/faq/referrals" />
</React.Fragment> </React.Fragment>
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -1,2 +0,0 @@
import CheckoutPage from './view';
export default CheckoutPage;

View file

@ -1,32 +0,0 @@
// @flow
import * as React from 'react';
import Page from 'component/page';
import Button from 'component/button';
import Card from 'component/common/card';
import CreditCards from './credit-card-logos.png';
export default function CheckoutPage() {
return (
<Page authPage>
<Card
title={__('Checkout')}
subtitle={__('Your cart contains 1 item.')}
body={
<div className="card--inline card--section card--highlighted">
<strong>{__('lbry.tv Premium - 1 month')}</strong>
<div>$5 per month</div>
</div>
}
actions={
<div className="section__actions">
<Button button="primary" label={__('Checkout')} />
<div>
<img src={CreditCards} style={{ height: '1.5rem' }} />
</div>
<div className="help">We will refund no questions asked within 30 days.</div>
</div>
}
/>
</Page>
);
}

View file

@ -3,6 +3,7 @@ import React from 'react';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import TxoList from 'component/txoList'; import TxoList from 'component/txoList';
import Page from 'component/page'; import Page from 'component/page';
import WalletBalance from 'component/walletBalance';
import Spinner from 'component/spinner'; import Spinner from 'component/spinner';
import YrblWalletEmpty from 'component/yrblWalletEmpty'; import YrblWalletEmpty from 'component/yrblWalletEmpty';
@ -34,6 +35,7 @@ const WalletPage = (props: Props) => {
<YrblWalletEmpty includeWalletLink /> <YrblWalletEmpty includeWalletLink />
) : ( ) : (
<div className="card-stack"> <div className="card-stack">
<WalletBalance />
<TxoList search={search} /> <TxoList search={search} />
</div> </div>
)} )}