update first subscription modal

This commit is contained in:
jessop 2019-11-18 16:57:03 -05:00 committed by Sean Yesmunt
parent 1a3eb38e0b
commit 6e511fd85c
3 changed files with 71 additions and 21 deletions

View file

@ -876,5 +876,17 @@
"Your videos are ready to be transferred.": "Your videos are ready to be transferred.",
"Ready to transfer": "Ready to transfer",
"Claim Channel": "Claim Channel",
"Say something about this...": "Say something about this..."
}
"Say something about this...": "Say something about this...",
"This will appear as a tip for %title%, which will boost its ability to be discovered while active.": "This will appear as a tip for %title%, which will boost its ability to be discovered while active.",
"Awesome! You just subscribed to your first channel. If we have your email address, we will send you notifications related to new content.": "Awesome! You just subscribed to your first channel. If we have your email address, we will send you notifications related to new content.",
"Update email preferences": "Update email preferences",
"Sign In to lbry.tv": "Sign In to lbry.tv",
"An account with lbry.tv allows you to earn rewards and backup your data.": "An account with lbry.tv allows you to earn rewards and backup your data.",
"Backup your account and wallet data.": "Backup your account and wallet data.",
"Awesome! You just subscribed to your first channel.": "Awesome! You just subscribed to your first channel.",
"Sign in": "Sign in",
"with lbry.tv to receive notifications related to new content.": "with lbry.tv to receive notifications related to new content.",
"An email was sent to %email%. Follow the link to %verify_text%. After, this page will update automatically.": "An email was sent to %email%. Follow the link to %verify_text%. After, this page will update automatically.",
"Your email preferences": "Your email preferences",
"allow you to receive notifications related to new content.": "allow you to receive notifications related to new content."
}

View file

@ -1,12 +1,21 @@
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
import { selectAccessToken, selectUser } from 'lbryinc';
import { withRouter } from 'react-router';
import ModalFirstSubscription from './view';
const select = state => ({
accessToken: selectAccessToken(state),
user: selectUser(state),
})
const perform = dispatch => () => ({
closeModal: () => dispatch(doHideModal()),
});
export default connect(
null,
export default withRouter(connect(
select,
perform
)(ModalFirstSubscription);
)(ModalFirstSubscription));

View file

@ -2,35 +2,64 @@
import React from 'react';
import { Modal } from 'modal/modal';
import Button from 'component/button';
import * as PAGES from 'constants/pages';
type Props = {
closeModal: () => void,
accessToken: string,
user: any,
doAuth: () => void,
history: { push: string => void },
location: UrlLocation,
};
const ModalFirstSubscription = (props: Props) => {
const { closeModal } = props;
const {
closeModal,
accessToken,
user,
history,
location: { pathname },
} = props;
return (
<Modal type="custom" isOpen contentLabel="Subscriptions 101" title={__('Subscriptions 101')}>
<div className="section__subtitle">
<p>{__('You just subscribed to your first channel. Awesome!')}</p>
<p>{__('A few quick things to know:')}</p>
<p>{__('Awesome! You just subscribed to your first channel.')}{' '}
{/* @if TARGET='web' */}
{__('You will receive notifications related to new content.')}
{/* @endif */}
{/* @if TARGET='app' */}
{ user && user.primary_email ? (
<React.Fragment>
{__('You will receive notifications related to new content.')}
</React.Fragment>
) : (
<React.Fragment>
<Button button="link" onClick={() => {
closeModal()
history.push(`/$/${PAGES.AUTH}?redirect=${pathname}`);
}} label={__('Sign in')} />{' '}
{ __('with lbry.tv to receive notifications related to new content.')}
</React.Fragment>
)}
{/* @endif */}
</p>
</div>
<ol className="section">
<li>
{__(
'This app will automatically download new free content from channels you are subscribed to. You may configure this in Settings or on the Subscriptions page.'
)}
{__('(Only available on the desktop app.)')}
</li>
<li>
{__(
'If we have your email address, we will send you notifications related to new content. You may configure these emails from the Help page.'
)}
</li>
</ol>
<div className="section__actions">
<Button button="primary" onClick={closeModal} label={__('Got it')} />
<React.Fragment>
{user && user.primary_email && (
<React.Fragment>
<Button
button="link"
href={`https://lbry.com/list/edit/${accessToken}`}
label={__('Update email preferences')}
/>
</React.Fragment>
)}
</React.Fragment>
</div>
</Modal>
);