@boomerang-io/carbon-addons-boomerang-react
Version:
Carbon Addons for Boomerang apps
46 lines (39 loc) • 2.33 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var react = require('@carbon/react');
var settings = require('../../internal/settings.js');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var React__default = /*#__PURE__*/_interopDefault(React);
/*
IBM Confidential
694970X, 69497O0
© Copyright IBM Corp. 2022, 2024
*/
function PrivacyRedirect(props) {
const { baseEnvUrl, isOpen = false, user, platformName = "the platform" } = props;
const handleOnSubmit = () => {
const pendingDeletion = user?.status === "pending_deletion";
if (pendingDeletion) {
window.location.assign(`${baseEnvUrl}/launchpad`); // There is no marketing site so TBD where this links to
}
else {
window.location.assign(`${baseEnvUrl}/launchpad?rd=${document.URL}`);
}
};
const pendingDeletion = user?.status === "pending_deletion";
const contentText = pendingDeletion
? `We’re working on removing your account and personal information from ${platformName}. Please allow up to 1 month (as mandated by GDPR regulations) for us to complete your request.`
: "Before continuing, we need you to consent to the Privacy Statement.";
const buttonText = pendingDeletion ? "Go to Launchpad" : "View Privacy Statement";
return (React__default.default.createElement("div", { className: `${settings.prefix}--bmrg-redirect-container ${settings.prefix}--bmrg-header-modal` },
React__default.default.createElement(react.ComposedModal, { "aria-label": "GDPR Modal", open: isOpen, onClose: () => {
return false;
} },
React__default.default.createElement(react.ModalHeader, { title: "Our Privacy Statement" }),
React__default.default.createElement(react.ModalBody, null,
React__default.default.createElement("span", { className: `${settings.prefix}--bmrg-redirect__body` }, contentText)),
React__default.default.createElement(react.ModalFooter, null,
React__default.default.createElement(react.Button, { "data-modal-primary-focus": true, kind: "primary", onClick: handleOnSubmit }, buttonText)))));
}
exports.default = PrivacyRedirect;