lbry-desktop/ui/modal/modalFirstSubscription/view.jsx

66 lines
1.9 KiB
React
Raw Normal View History

2018-09-26 19:48:07 +02:00
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
2018-03-26 23:32:43 +02:00
import Button from 'component/button';
2019-11-18 22:57:03 +01:00
import * as PAGES from 'constants/pages';
2018-09-26 19:48:07 +02:00
type Props = {
closeModal: () => void,
2019-11-18 22:57:03 +01:00
accessToken: string,
user: any,
doAuth: () => void,
history: { push: string => void },
location: UrlLocation,
2018-09-26 19:48:07 +02:00
};
const ModalFirstSubscription = (props: Props) => {
2019-11-18 22:57:03 +01:00
const {
closeModal,
accessToken,
user,
history,
location: { pathname },
} = props;
return (
2018-09-26 19:48:07 +02:00
<Modal type="custom" isOpen contentLabel="Subscriptions 101" title={__('Subscriptions 101')}>
2019-09-26 18:07:11 +02:00
<div className="section__subtitle">
2019-11-18 22:57:03 +01:00
<p>{__('Awesome! You just subscribed to your first channel.')}{' '}
{ user && user.primary_email ? (
<React.Fragment>
{__('You will receive notifications related to new content.')}
</React.Fragment>
) : (
<React.Fragment>
2019-11-19 22:59:29 +01:00
{ __('Sign in with lbry.tv to receive notifications about new content.')}
2019-11-18 22:57:03 +01:00
</React.Fragment>
2019-09-26 18:07:11 +02:00
)}
2019-11-18 22:57:03 +01:00
</p>
</div>
2019-09-26 18:07:11 +02:00
<div className="section__actions">
2019-07-21 23:31:22 +02:00
<Button button="primary" onClick={closeModal} label={__('Got it')} />
2019-11-18 22:57:03 +01:00
<React.Fragment>
2019-11-19 22:59:29 +01:00
{user && user.primary_email ? (
2019-11-18 22:57:03 +01:00
<React.Fragment>
<Button
button="link"
href={`https://lbry.com/list/edit/${accessToken}`}
label={__('Update email preferences')}
/>
</React.Fragment>
2019-11-19 22:59:29 +01:00
) : (
<React.Fragment>
<Button button="link" onClick={() => {
closeModal()
history.push(`/$/${PAGES.AUTH}?redirect=${pathname}`);
}} label={__('Sign in')} />
</React.Fragment>
2019-11-18 22:57:03 +01:00
)}
</React.Fragment>
2019-07-21 23:31:22 +02:00
</div>
</Modal>
);
};
export default ModalFirstSubscription;