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

66 lines
1.9 KiB
React
Raw Normal View History

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