diff --git a/src/components/dropdown-banner/email-confirmation/banner.jsx b/src/components/dropdown-banner/email-confirmation/banner.jsx new file mode 100644 index 000000000..c197b02df --- /dev/null +++ b/src/components/dropdown-banner/email-confirmation/banner.jsx @@ -0,0 +1,46 @@ +import React, {useState} from 'react'; +import DropdownBanner from '../banner.jsx'; + + +/* { // eslint-disable-line react/jsx-no-bind + this.emailConfirmationiFrame = iframe; + }} + isOpen={this.props.emailConfirmationModalOpen} + key="iframe-modal" + src="/accounts/email_resend_standalone/" + onRequestClose={this.props.onHideEmailConfirmationModal} + /> */ + + +const EmailConfirmationBanner = onRequestDismiss => { + + const [showEmailConfirmationModal, setShowEmailConfirmationModal] = useState(false); + + return ( + + {(showEmailConfirmationModal &&

test

)} + + + Confirm your email + {' '}to enable sharing.{' '} + + Having trouble? + + +
); +}; + +EmailConfirmationBanner.propTypes = { + +}; + +module.exports = EmailConfirmationBanner; diff --git a/src/components/modal/email-confirmation/modal.jsx b/src/components/modal/email-confirmation/modal.jsx new file mode 100644 index 000000000..9ed283b1e --- /dev/null +++ b/src/components/modal/email-confirmation/modal.jsx @@ -0,0 +1,26 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import {FormattedMessage} from 'react-intl'; + +import Modal from '../base/modal.jsx'; +import ModalTitle from '../base/modal-title.jsx'; +// import ModalInnerContent from '../../../components/modal/base/modal-inner-content.jsx'; + +// import './manager-limit-modal.scss'; +// import {STUDIO_MANAGER_LIMIT} from '../../../redux/studio.js'; + + +const EmailConfirmationModal = () => ( + + + test 1234 + +); + +EmailConfirmationModal.propTypes = { + handleClose: PropTypes.func +}; + +export default EmailConfirmationModal; diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index 408bed818..5762e4736 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -32,6 +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/emailConfirmation/modal.jsx').default; const projectShape = require('./projectshape.jsx').projectShape; require('./preview.scss'); @@ -62,6 +63,7 @@ const PreviewPresentation = ({ canRestoreComments, canSave, canShare, + canSeeShare, canToggleComments, canUseBackpack, cloudHost, @@ -109,6 +111,7 @@ const PreviewPresentation = ({ onSeeInside, onSetProjectThumbnailer, onShare, + onShareAttempt, onSocialClicked, onSocialClosed, onToggleComments, @@ -129,6 +132,7 @@ const PreviewPresentation = ({ reportOpen, showAdminPanel, showModInfo, + showEmailConfirmationModal, singleCommentId, socialOpen, userOwnsProject, @@ -170,7 +174,7 @@ const PreviewPresentation = ({ } /> ); - } else if (canShare) { + } else if (canSeeShare) { if (isShared && justShared) { // if was shared a while ago, don't show any share banner if (isNewScratcher) { banner = (); } } else if (!isShared) { - banner = (} - message={} - onAction={onShare} - />); + if (canShare){ + banner = (} + message={} + onAction={onShare} + />); + } else { + banner = (} + message={} + onAction={onShareAttempt} + /> + ); + } } } @@ -208,6 +221,7 @@ const PreviewPresentation = ({ ); return (
+ {showEmailConfirmationModal && } {showAdminPanel && ( - {this.props.shouldShowEmailConfirmation ? [ - { // eslint-disable-line react/jsx-no-bind + {(this.props.shouldShowEmailConfirmation && + { // eslint-disable-line react/jsx-no-bind this.props.onDismiss('confirmed_email'); }} - > - - Confirm your email - {' '}to enable sharing.{' '} - - Having trouble? - - , - { // eslint-disable-line react/jsx-no-bind - this.emailConfirmationiFrame = iframe; - }} - isOpen={this.props.emailConfirmationModalOpen} - key="iframe-modal" - src="/accounts/email_resend_standalone/" - onRequestClose={this.props.onHideEmailConfirmationModal} - /> - ] : []} + />)} {this.props.isEducator ? [