Give EmailConfirmModal email address prop

This commit is contained in:
seotts 2021-11-12 15:40:52 -05:00
parent f7008f533d
commit 8b62fb9f63
3 changed files with 23 additions and 72 deletions

View file

@ -2,7 +2,8 @@
import React, {useState} from 'react';
import PropTypes from 'prop-types';
import DropdownBanner from '../banner.jsx';
import EmailConfirmationModal from '../../../components/modal/email-confirmation/modal.jsx';
const EmailConfirmationModal = require('../../../components/modal/email-confirmation/modal.jsx');
const EmailConfirmationBanner = ({onRequestDismiss}) => {

View file

@ -1,80 +1,30 @@
import React, {useState} from 'react';
const connect = require('react-redux').connect;
import React from 'react';
import PropTypes from 'prop-types';
import {FormattedMessage} from 'react-intl';
import Modal from '../base/modal.jsx';
require('./modal.scss');
import ModalTitle from '../base/modal-title.jsx';
// import ModalInnerContent from '../../../components/modal/base/modal-inner-content.jsx';
const EmailConfirmationModal = ({
email, handleClose
}) => {
const [showEmailTips, setShowEmailTips] = useState(false);
// import './manager-limit-modal.scss';
// import {STUDIO_MANAGER_LIMIT} from '../../../redux/studio.js';
return (
<Modal
isOpen
showCloseButton
useStandardSizes
onRequestClose={handleClose}
>
<div className="top-close-bar" />
<div className="modal-middle-content">
<img
className="modal-image"
alt="email-confirmation-illustration"
src="/svgs/modal/confirm-email-illustration.svg"
/>
<div className="modal-right-content">
{showEmailTips ?
(<React.Fragment>
<h1><FormattedMessage id="registration.emailConfirmationModalHeader2" /></h1>
<p><FormattedMessage id="registration.emailConfirmationModalTipWaitForTenMinutes" /></p>
<p><FormattedMessage id="registration.emailConfirmationModalTipCheckYourSpam" /></p>
<p><FormattedMessage
id="registration.emailConfirmationModalTipMakeSureYourEmail"
values={{AccountSettings: (<a href="/accounts/email_change/"><FormattedMessage id="registration.emailConfirmationModalAccountSettings" /></a>)}}
/></p>
</React.Fragment>) :
(<React.Fragment>
<h1><FormattedMessage id="registration.emailConfirmationModalHeader1" /></h1>
<p><FormattedMessage id="registration.emailConfirmationModalWantToShare" /></p>
<p><FormattedMessage id="registration.emailConfirmationModalClickEmailLink" /></p>
<p><b>{email}</b></p>
<a href="/accounts/email_change/"><FormattedMessage id="registration.emailConfirmationModalResendEmail" /></a>
</React.Fragment>)
}
</div>
</div>
<div className="guide-footer">
{showEmailTips ?
(<React.Fragment>
<FormattedMessage
id="registration.emailConfirmationModalWantMoreInfo"
values={{FAQLink: (<a href="/faq"><FormattedMessage id="registration.emailConfirmationModalCheckOutFAQ" /></a>)}}
/>
</React.Fragment>) :
(<React.Fragment>
<FormattedMessage
id="registration.emailConfirmationModalHavingTrouble"
values={{TipsLink: (
<a
onClick={e => { // eslint-disable-line react/jsx-no-bind
e.preventDefault();
setShowEmailTips(true);
}}
>
<FormattedMessage id="registration.emailConfirmationModalCheckOutTips" />
</a>)}}
/>
</React.Fragment>)}
</div>
</Modal>);
};
const EmailConfirmationModal = props => (
<Modal
isOpen
>
<ModalTitle />
<p>{props.email}</p>
</Modal>
);
EmailConfirmationModal.propTypes = {
handleClose: PropTypes.func,
email: PropTypes.string
email: PropTypes.string,
handleClose: PropTypes.func
};
const mapStateToProps = state => ({
email: state.session.session.user.email
});
export default EmailConfirmationModal;
module.exports = connect(mapStateToProps)(EmailConfirmationModal);

View file

@ -32,7 +32,7 @@ const ComposeComment = require('./comment/compose-comment.jsx');
const ExtensionChip = require('./extension-chip.jsx');
const thumbnailUrl = require('../../lib/user-thumbnail');
const FormsyProjectUpdater = require('./formsy-project-updater.jsx');
const EmailConfirmationModal = require('../../components/modal/email-confirmation/modal.jsx').default;
const EmailConfirmationModal = require('../../components/modal/email-confirmation/modal.jsx');
const EmailConfirmationBanner = require('../../components/dropdown-banner/email-confirmation/banner.jsx');
const projectShape = require('./projectshape.jsx').projectShape;