synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
94 lines (93 loc) • 3.1 kB
JavaScript
import { jsx as o, Fragment as l, jsxs as r } from "react/jsx-runtime";
import { useCookiePreferences as k, COOKIES_AGREEMENT_COOKIE_KEY as x, allowNone as u, allowAll as f } from "../../utils/hooks/useCookiePreferences.js";
import { PRIVACY_POLICY_LINK as g, URL_TERMS_CONDITIONS_AGREEMENT as h, CHILD_MINOR_ADDENDUM_LINK as A } from "../../utils/SynapseConstants.js";
import { Typography as m, Link as a } from "@mui/material";
import { useState as d, useEffect as b } from "react";
import I from "universal-cookie";
import T from "../FullWidthAlert/FullWidthAlert.js";
import E from "./CookiePreferencesDialog.js";
import N from "./CookiesNotification.module.scss.js";
const t = {
title: "Our site uses cookies.",
description: /* @__PURE__ */ r(l, { children: [
/* @__PURE__ */ r(m, { variant: "body1", children: [
"We use necessary cookies and store your data to ensure our websites function properly. With your consent, we would also like to use optional cookies to remember your preferences and improve our websites. Please read our ",
/* @__PURE__ */ o(a, { href: g, children: "Privacy Policy" }),
" for details. By clicking “Allow All,” you agree to our use of cookies. You can adjust your cookie preferences anytime on the Settings page."
] }),
/* @__PURE__ */ r(
m,
{
variant: "smallText1",
sx: { mt: "20px" },
className: N.MinorAddendum,
children: [
"Please read our",
" ",
/* @__PURE__ */ o(a, { href: h, children: "Terms of Service" }),
" ",
"before using our website. If you are between 13 and 18, you must submit a ",
/* @__PURE__ */ o(a, { href: A, children: "Child Minor Addendum" }),
" for access."
]
}
)
] }),
primaryButtonText: "ALLOW ALL",
secondaryButtonText: "Disable All",
tertiaryButtonText: "Customize"
}, M = (p) => {
const { onClose: e } = p, [, c] = k(), [y, i] = d(!0);
b(() => {
const n = new I();
i(!!n.get(x));
}, []);
const [C, s] = d(!1);
return y ? /* @__PURE__ */ o(l, {}) : /* @__PURE__ */ r(l, { children: [
/* @__PURE__ */ o(
T,
{
globalAlertSx: { zIndex: 1500 },
variant: "info",
title: t.title,
description: t.description,
primaryButtonConfig: {
text: t.primaryButtonText,
onClick: () => {
c(f), i(!0), e && e(f);
}
},
secondaryButtonConfig: {
text: t.secondaryButtonText,
onClick: () => {
c(u), i(!0), e && e(u);
}
},
tertiaryButtonConfig: {
text: t.tertiaryButtonText,
onClick: () => {
s(!0);
}
},
isGlobal: !0
}
),
/* @__PURE__ */ o(
E,
{
isOpen: C,
onSave: (n) => {
i(!0), s(!1), e && e(n);
},
onHide: () => {
s(!1);
}
}
)
] });
};
export {
t as alertConfig,
M as default
};
//# sourceMappingURL=CookiesNotification.js.map