From 8b62fb9f63d788d324dd165aa8819734fe3edbec Mon Sep 17 00:00:00 2001 From: seotts Date: Fri, 12 Nov 2021 15:40:52 -0500 Subject: [PATCH] Give EmailConfirmModal email address prop --- .../email-confirmation/banner.jsx | 3 +- .../modal/email-confirmation/modal.jsx | 90 +++++-------------- src/views/preview/presentation.jsx | 2 +- 3 files changed, 23 insertions(+), 72 deletions(-) diff --git a/src/components/dropdown-banner/email-confirmation/banner.jsx b/src/components/dropdown-banner/email-confirmation/banner.jsx index 051a646ad..5798e52cf 100644 --- a/src/components/dropdown-banner/email-confirmation/banner.jsx +++ b/src/components/dropdown-banner/email-confirmation/banner.jsx @@ -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}) => { diff --git a/src/components/modal/email-confirmation/modal.jsx b/src/components/modal/email-confirmation/modal.jsx index ff8a926fe..66ea42f18 100644 --- a/src/components/modal/email-confirmation/modal.jsx +++ b/src/components/modal/email-confirmation/modal.jsx @@ -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 ( - -
-
- email-confirmation-illustration - -
- {showEmailTips ? - ( -

-

-

-

)}} - />

-
) : - ( -

-

-

-

{email}

- -
) - } -
-
-
- {showEmailTips ? - ( - )}} - /> - ) : - ( - { // eslint-disable-line react/jsx-no-bind - e.preventDefault(); - setShowEmailTips(true); - }} - > - - )}} - /> - )} -
- ); -}; +const EmailConfirmationModal = props => ( + + +

{props.email}

+
+); 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); diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index d28f437f6..875c8adeb 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -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;