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

74 lines
2.1 KiB
React
Raw Permalink Normal View History

2018-09-26 19:48:07 +02:00
// @flow
2021-10-22 18:55:08 +02:00
import { CLOUD_CONNECT_SITE_NAME } from 'config';
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';
import Card from 'component/common/card';
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,
2021-10-22 18:55:08 +02:00
history: { push: (string) => void },
2019-11-18 22:57:03 +01:00
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;
const title = __('You Followed Your First Channel!');
return (
<Modal type="card" isOpen contentLabel={title}>
<Card
title={title}
subtitle={
<>
{__('Awesome! You just followed your first channel.')}{' '}
{user && user.primary_email
? __('You will receive notifications related to new content.')
2021-10-22 18:55:08 +02:00
: __('Connect to %SITE_NAME% to receive notifications about new content.', { CLOUD_CONNECT_SITE_NAME })}
</>
}
actions={
<div className="section__actions">
<Button button="primary" onClick={closeModal} label={__('Got it')} />
2019-11-19 22:59:29 +01:00
<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>
<Button
button="link"
onClick={() => {
closeModal();
history.push(`/$/${PAGES.AUTH}?redirect=${pathname}`);
}}
2020-08-24 19:59:37 +02:00
label={__('Log in')}
/>
</React.Fragment>
)}
2019-11-19 22:59:29 +01:00
</React.Fragment>
</div>
}
/>
</Modal>
);
};
export default ModalFirstSubscription;