2018-09-26 19:48:07 +02:00
|
|
|
// @flow
|
2018-03-16 19:22:19 +01:00
|
|
|
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';
|
2020-06-10 00:09:24 +02:00
|
|
|
import Card from 'component/common/card';
|
2018-03-16 19:22:19 +01:00
|
|
|
|
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;
|
2018-03-16 19:22:19 +01:00
|
|
|
|
2020-06-10 00:09:24 +02:00
|
|
|
const title = __('You Followed Your First Channel!');
|
|
|
|
|
2018-03-16 19:22:19 +01:00
|
|
|
return (
|
2020-06-10 00:09:24 +02:00
|
|
|
<Modal type="card" isOpen contentLabel={title}>
|
|
|
|
<Card
|
|
|
|
title={title}
|
|
|
|
subtitle={
|
|
|
|
<>
|
2020-08-02 20:33:08 +02:00
|
|
|
{__('Awesome! You just followed your first channel.')}{' '}
|
2020-06-10 00:09:24 +02:00
|
|
|
{user && user.primary_email
|
|
|
|
? __('You will receive notifications related to new content.')
|
|
|
|
: __('Sign in with lbry.tv to receive notifications about new content.')}
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
actions={
|
|
|
|
<div className="section__actions">
|
|
|
|
<Button button="primary" onClick={closeModal} label={__('Got it')} />
|
2019-11-19 22:59:29 +01:00
|
|
|
<React.Fragment>
|
2020-06-10 00:09:24 +02:00
|
|
|
{user && user.primary_email ? (
|
|
|
|
<React.Fragment>
|
|
|
|
<Button
|
|
|
|
button="link"
|
|
|
|
href={`https://lbry.com/list/edit/${accessToken}`}
|
|
|
|
label={__('Update email preferences')}
|
|
|
|
/>
|
|
|
|
</React.Fragment>
|
|
|
|
) : (
|
|
|
|
<React.Fragment>
|
|
|
|
<Button
|
|
|
|
button="link"
|
|
|
|
onClick={() => {
|
|
|
|
closeModal();
|
|
|
|
history.push(`/$/${PAGES.AUTH}?redirect=${pathname}`);
|
|
|
|
}}
|
|
|
|
label={__('Sign in')}
|
|
|
|
/>
|
|
|
|
</React.Fragment>
|
|
|
|
)}
|
2019-11-19 22:59:29 +01:00
|
|
|
</React.Fragment>
|
2020-06-10 00:09:24 +02:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
/>
|
2018-03-16 19:22:19 +01:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ModalFirstSubscription;
|