synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
121 lines (120 loc) • 4.63 kB
JavaScript
import { jsxs as i, jsx as e } from "react/jsx-runtime";
import { useCookiePreferences as w } from "../../utils/hooks/useCookiePreferences.js";
import { PRIVACY_POLICY_LINK as p } from "../../utils/SynapseConstants.js";
import { Dialog as k, DialogContent as x, Typography as n, Link as b, DialogActions as v, Button as C, Box as h, Checkbox as A } from "@mui/material";
import { useState as f } from "react";
import { DialogBaseTitle as I } from "../DialogBase.js";
function s(o) {
const { title: r, description: a } = o, t = "onChange" in o;
return /* @__PURE__ */ i(
h,
{
onClick: () => t ? o.onChange(!o.checked) : void 0,
sx: { cursor: t ? "pointer" : void 0 },
children: [
/* @__PURE__ */ i(
h,
{
sx: {
display: "flex",
justifyContent: "space-between",
marginTop: "17px",
alignItems: "center"
},
children: [
/* @__PURE__ */ e(
n,
{
variant: "body1",
sx: { fontWeight: 400, color: "grey.900" },
children: r
}
),
"constantValue" in o && /* @__PURE__ */ e(
n,
{
variant: "body1",
sx: { fontWeight: 700, marginBottom: "15px" },
children: o.constantValue
}
),
t && /* @__PURE__ */ e(
A,
{
checked: o.checked
}
)
]
}
),
/* @__PURE__ */ e(n, { variant: "body1", sx: { fontWeight: 400, color: "grey.700" }, children: a })
]
}
);
}
function V(o) {
const [r, a] = w(), { onSave: t, onHide: c, isOpen: m } = o, [l, y] = f(r.functionalAllowed), [u, g] = f(r.analyticsAllowed);
return /* @__PURE__ */ i(k, { maxWidth: "md", open: m, onClose: c, sx: { zIndex: 1500 }, children: [
/* @__PURE__ */ e(I, { title: "Privacy Preferences", onCancel: c }),
/* @__PURE__ */ i(x, { sx: { paddingRight: "20px" }, children: [
/* @__PURE__ */ e(n, { variant: "body1", children: "Sage Bionetworks uses cookies and other browser storage methods to save information about how you use our websites, and to make our websites work the way you expect them to." }),
/* @__PURE__ */ i(n, { variant: "body1", sx: { marginBottom: "30px" }, children: [
"Read our ",
/* @__PURE__ */ e(b, { href: p, children: "privacy policy" }),
"."
] }),
/* @__PURE__ */ e(
s,
{
title: "Strictly necessary cookies",
description: "Information about your authentication, and other critical data. For example, after you log in successfully, we save a token in your browser that tells our website what level of access you are allowed to have. You can’t turn off these cookies, because the site wouldn’t function without them.",
constantValue: "Always Active"
}
),
/* @__PURE__ */ e(
s,
{
title: "Functional cookies",
description: "This includes important customization preferences, for example, your local time, and whether you are using experimental features. You can turn off this setting, however it may impact your experience of using our websites.",
checked: l,
onChange: y
}
),
/* @__PURE__ */ e(
s,
{
title: "Analytics cookie",
description: "If you allow us to, we store information about how you use our websites. This helps us identify problems and improve our products. While we do not attempt to track you, it may be possible to identify individual users. Deactivating this setting will not affect your experience of using our websites.",
checked: u,
onChange: g
}
),
/* @__PURE__ */ e(
s,
{
title: "Targeting and marketing cookies",
description: "We do not store or exchange user or session information for targeting or marketing purposes.",
constantValue: "Never"
}
)
] }),
/* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(
C,
{
variant: "contained",
onClick: () => {
const d = {
functionalAllowed: l,
analyticsAllowed: u
};
a(d), t(d);
},
children: "Save"
}
) })
] });
}
export {
V as default
};
//# sourceMappingURL=CookiePreferencesDialog.js.map