@pelcro/react-pelcro-js 3.48.0 → 3.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +136 -3
- package/dist/index.esm.js +136 -3
- package/dist/pelcro.css +5 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3970,6 +3970,10 @@ var labels$V = {
|
|
|
3970
3970
|
},
|
|
3971
3971
|
subCancellation: {
|
|
3972
3972
|
goBack: "Go back"
|
|
3973
|
+
},
|
|
3974
|
+
emailPreferences: {
|
|
3975
|
+
label: "Email Notifications",
|
|
3976
|
+
description: "Select which email updates you would like to receive:"
|
|
3973
3977
|
}
|
|
3974
3978
|
};
|
|
3975
3979
|
var messages$W = {
|
|
@@ -4866,6 +4870,10 @@ var labels$E = {
|
|
|
4866
4870
|
},
|
|
4867
4871
|
subCancellation: {
|
|
4868
4872
|
goBack: "Retourner"
|
|
4873
|
+
},
|
|
4874
|
+
emailPreferences: {
|
|
4875
|
+
label: "Notifications par courriel",
|
|
4876
|
+
description: "Sélectionnez les mises à jour par courriel que vous souhaitez recevoir:"
|
|
4869
4877
|
}
|
|
4870
4878
|
};
|
|
4871
4879
|
var messages$E = {
|
|
@@ -31567,6 +31575,123 @@ function getMemberShipStatus(status) {
|
|
|
31567
31575
|
};
|
|
31568
31576
|
}
|
|
31569
31577
|
|
|
31578
|
+
const EmailPreferencesMenu = props => {
|
|
31579
|
+
const {
|
|
31580
|
+
t
|
|
31581
|
+
} = useTranslation("dashboard");
|
|
31582
|
+
const [options, setOptions] = React.useState([]);
|
|
31583
|
+
const [loading, setLoading] = React.useState({});
|
|
31584
|
+
const [alert, setAlert] = React.useState({});
|
|
31585
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
31586
|
+
const [error, setError] = React.useState(null);
|
|
31587
|
+
React.useEffect(() => {
|
|
31588
|
+
var _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
31589
|
+
const options = ((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.newsletters) || [];
|
|
31590
|
+
const email = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.email) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : window.Pelcro.helpers.getURLParameter("email");
|
|
31591
|
+
setIsLoading(true);
|
|
31592
|
+
window.Pelcro.newsletter.getByEmail(email, (err, res) => {
|
|
31593
|
+
var _res$data$lists$split, _res$data, _res$data$lists;
|
|
31594
|
+
if (err) {
|
|
31595
|
+
setIsLoading(false);
|
|
31596
|
+
setError(t("messages.error") || "Failed to load preferences.");
|
|
31597
|
+
return;
|
|
31598
|
+
}
|
|
31599
|
+
const selectedIds = (_res$data$lists$split = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$lists = _res$data.lists) === null || _res$data$lists === void 0 ? void 0 : _res$data$lists.split(",")) !== null && _res$data$lists$split !== void 0 ? _res$data$lists$split : [];
|
|
31600
|
+
setOptions(options.map(opt => ({
|
|
31601
|
+
...opt,
|
|
31602
|
+
id: String(opt.id),
|
|
31603
|
+
selected: selectedIds.includes(String(opt.id))
|
|
31604
|
+
})));
|
|
31605
|
+
setIsLoading(false);
|
|
31606
|
+
setError(null);
|
|
31607
|
+
});
|
|
31608
|
+
}, [t]);
|
|
31609
|
+
const handleCheckboxChange = id => e => {
|
|
31610
|
+
const checked = e.target.checked;
|
|
31611
|
+
setOptions(prevOptions => {
|
|
31612
|
+
var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
|
|
31613
|
+
const newOptions = prevOptions.map(opt => opt.id === id ? {
|
|
31614
|
+
...opt,
|
|
31615
|
+
selected: checked
|
|
31616
|
+
} : opt);
|
|
31617
|
+
// Set loading for this checkbox
|
|
31618
|
+
setLoading(prev => ({
|
|
31619
|
+
...prev,
|
|
31620
|
+
[id]: true
|
|
31621
|
+
}));
|
|
31622
|
+
setAlert(prev => ({
|
|
31623
|
+
...prev,
|
|
31624
|
+
[id]: null
|
|
31625
|
+
}));
|
|
31626
|
+
// Save to backend
|
|
31627
|
+
const selectedIds = newOptions.filter(opt => opt.selected).map(opt => opt.id);
|
|
31628
|
+
const email = (_window$Pelcro$user$r3 = (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : window.Pelcro.helpers.getURLParameter("email");
|
|
31629
|
+
const requestData = {
|
|
31630
|
+
email,
|
|
31631
|
+
source: "web",
|
|
31632
|
+
lists: selectedIds.join(",")
|
|
31633
|
+
};
|
|
31634
|
+
|
|
31635
|
+
// Check if this is a new subscription
|
|
31636
|
+
window.Pelcro.newsletter.getByEmail(email, (err, res) => {
|
|
31637
|
+
if (err) {
|
|
31638
|
+
setLoading(prev => ({
|
|
31639
|
+
...prev,
|
|
31640
|
+
[id]: false
|
|
31641
|
+
}));
|
|
31642
|
+
setAlert(prev => ({
|
|
31643
|
+
...prev,
|
|
31644
|
+
[id]: "Error checking subscription status"
|
|
31645
|
+
}));
|
|
31646
|
+
return;
|
|
31647
|
+
}
|
|
31648
|
+
const didSubToNewslettersBefore = Boolean(res.data.email);
|
|
31649
|
+
const callback = err => {
|
|
31650
|
+
setLoading(prev => ({
|
|
31651
|
+
...prev,
|
|
31652
|
+
[id]: false
|
|
31653
|
+
}));
|
|
31654
|
+
setAlert(prev => ({
|
|
31655
|
+
...prev,
|
|
31656
|
+
[id]: err ? "Error saving" : "Saved!"
|
|
31657
|
+
}));
|
|
31658
|
+
};
|
|
31659
|
+
if (didSubToNewslettersBefore) {
|
|
31660
|
+
window.Pelcro.newsletter.update(requestData, callback);
|
|
31661
|
+
} else {
|
|
31662
|
+
window.Pelcro.newsletter.create(requestData, callback);
|
|
31663
|
+
}
|
|
31664
|
+
});
|
|
31665
|
+
return newOptions;
|
|
31666
|
+
});
|
|
31667
|
+
};
|
|
31668
|
+
if (isLoading) return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31669
|
+
className: "plc-flex plc-justify-center plc-items-center plc-h-32"
|
|
31670
|
+
}, /*#__PURE__*/React__default['default'].createElement(Loader, {
|
|
31671
|
+
width: 60,
|
|
31672
|
+
height: 100
|
|
31673
|
+
}));
|
|
31674
|
+
if (error) return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31675
|
+
className: "plc-text-red-600 plc-p-4"
|
|
31676
|
+
}, error);
|
|
31677
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31678
|
+
className: "plc-mb-4 plc-text-sm plc-text-gray-600"
|
|
31679
|
+
}, t("labels.emailPreferences.description") || "Select which email updates you would like to receive."), options.map(opt => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
31680
|
+
key: opt.id,
|
|
31681
|
+
className: "plc-flex plc-items-center plc-mb-2"
|
|
31682
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
31683
|
+
type: "checkbox",
|
|
31684
|
+
id: `email-pref-${opt.id}`,
|
|
31685
|
+
checked: !!opt.selected,
|
|
31686
|
+
onChange: handleCheckboxChange(opt.id),
|
|
31687
|
+
disabled: loading[opt.id],
|
|
31688
|
+
className: "plc-mr-2"
|
|
31689
|
+
}), /*#__PURE__*/React__default['default'].createElement("label", {
|
|
31690
|
+
htmlFor: `email-pref-${opt.id}`,
|
|
31691
|
+
className: "plc-text-base"
|
|
31692
|
+
}, opt.label))));
|
|
31693
|
+
};
|
|
31694
|
+
|
|
31570
31695
|
const SUB_MENUS = {
|
|
31571
31696
|
PROFILE: "profile",
|
|
31572
31697
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -31577,7 +31702,8 @@ const SUB_MENUS = {
|
|
|
31577
31702
|
GIFTS: "gifts",
|
|
31578
31703
|
ORDERS: "orders",
|
|
31579
31704
|
INVOICES: "invoices",
|
|
31580
|
-
SAVED_ITEMS: "saved-items"
|
|
31705
|
+
SAVED_ITEMS: "saved-items",
|
|
31706
|
+
EMAIL_PREFERENCES: "email-preferences"
|
|
31581
31707
|
};
|
|
31582
31708
|
|
|
31583
31709
|
/**
|
|
@@ -32071,13 +32197,14 @@ class Dashboard extends React.Component {
|
|
|
32071
32197
|
this.enableReactGA4 = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro = _window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableReactGA4;
|
|
32072
32198
|
}
|
|
32073
32199
|
render() {
|
|
32074
|
-
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet;
|
|
32200
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
32075
32201
|
const {
|
|
32076
32202
|
isOpen
|
|
32077
32203
|
} = this.state;
|
|
32078
32204
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
32079
32205
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
32080
32206
|
const newsletters = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.newsletters;
|
|
32207
|
+
const emailNotifications = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.emailNotifications;
|
|
32081
32208
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
32082
32209
|
return /*#__PURE__*/React__default['default'].createElement(Transition, {
|
|
32083
32210
|
className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full plc-max-w-xl plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
|
|
@@ -32155,7 +32282,7 @@ class Dashboard extends React.Component {
|
|
|
32155
32282
|
}),
|
|
32156
32283
|
className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
|
|
32157
32284
|
onClick: this.displayChangePassword
|
|
32158
|
-
}, this.locale("labels.changePassword")), siteHasNewslettersDefined && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
32285
|
+
}, this.locale("labels.changePassword")), siteHasNewslettersDefined && emailNotifications !== true && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
32159
32286
|
variant: "ghost",
|
|
32160
32287
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgNewsletter, {
|
|
32161
32288
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -32245,6 +32372,12 @@ class Dashboard extends React.Component {
|
|
|
32245
32372
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
|
|
32246
32373
|
title: this.locale("labels.savedItems.label"),
|
|
32247
32374
|
content: /*#__PURE__*/React__default['default'].createElement(SavedItemsMenu, null)
|
|
32375
|
+
}), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
|
|
32376
|
+
show: emailNotifications === true,
|
|
32377
|
+
name: SUB_MENUS.EMAIL_PREFERENCES,
|
|
32378
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
|
|
32379
|
+
title: this.locale("labels.emailPreferences.label"),
|
|
32380
|
+
content: /*#__PURE__*/React__default['default'].createElement(EmailPreferencesMenu, null)
|
|
32248
32381
|
}), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
32249
32382
|
variant: "outline",
|
|
32250
32383
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgExit, null),
|
package/dist/index.esm.js
CHANGED
|
@@ -3940,6 +3940,10 @@ var labels$V = {
|
|
|
3940
3940
|
},
|
|
3941
3941
|
subCancellation: {
|
|
3942
3942
|
goBack: "Go back"
|
|
3943
|
+
},
|
|
3944
|
+
emailPreferences: {
|
|
3945
|
+
label: "Email Notifications",
|
|
3946
|
+
description: "Select which email updates you would like to receive:"
|
|
3943
3947
|
}
|
|
3944
3948
|
};
|
|
3945
3949
|
var messages$W = {
|
|
@@ -4836,6 +4840,10 @@ var labels$E = {
|
|
|
4836
4840
|
},
|
|
4837
4841
|
subCancellation: {
|
|
4838
4842
|
goBack: "Retourner"
|
|
4843
|
+
},
|
|
4844
|
+
emailPreferences: {
|
|
4845
|
+
label: "Notifications par courriel",
|
|
4846
|
+
description: "Sélectionnez les mises à jour par courriel que vous souhaitez recevoir:"
|
|
4839
4847
|
}
|
|
4840
4848
|
};
|
|
4841
4849
|
var messages$E = {
|
|
@@ -31537,6 +31545,123 @@ function getMemberShipStatus(status) {
|
|
|
31537
31545
|
};
|
|
31538
31546
|
}
|
|
31539
31547
|
|
|
31548
|
+
const EmailPreferencesMenu = props => {
|
|
31549
|
+
const {
|
|
31550
|
+
t
|
|
31551
|
+
} = useTranslation("dashboard");
|
|
31552
|
+
const [options, setOptions] = useState([]);
|
|
31553
|
+
const [loading, setLoading] = useState({});
|
|
31554
|
+
const [alert, setAlert] = useState({});
|
|
31555
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
31556
|
+
const [error, setError] = useState(null);
|
|
31557
|
+
useEffect(() => {
|
|
31558
|
+
var _window$Pelcro, _window$Pelcro$uiSett, _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
31559
|
+
const options = ((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.newsletters) || [];
|
|
31560
|
+
const email = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.email) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : window.Pelcro.helpers.getURLParameter("email");
|
|
31561
|
+
setIsLoading(true);
|
|
31562
|
+
window.Pelcro.newsletter.getByEmail(email, (err, res) => {
|
|
31563
|
+
var _res$data$lists$split, _res$data, _res$data$lists;
|
|
31564
|
+
if (err) {
|
|
31565
|
+
setIsLoading(false);
|
|
31566
|
+
setError(t("messages.error") || "Failed to load preferences.");
|
|
31567
|
+
return;
|
|
31568
|
+
}
|
|
31569
|
+
const selectedIds = (_res$data$lists$split = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$lists = _res$data.lists) === null || _res$data$lists === void 0 ? void 0 : _res$data$lists.split(",")) !== null && _res$data$lists$split !== void 0 ? _res$data$lists$split : [];
|
|
31570
|
+
setOptions(options.map(opt => ({
|
|
31571
|
+
...opt,
|
|
31572
|
+
id: String(opt.id),
|
|
31573
|
+
selected: selectedIds.includes(String(opt.id))
|
|
31574
|
+
})));
|
|
31575
|
+
setIsLoading(false);
|
|
31576
|
+
setError(null);
|
|
31577
|
+
});
|
|
31578
|
+
}, [t]);
|
|
31579
|
+
const handleCheckboxChange = id => e => {
|
|
31580
|
+
const checked = e.target.checked;
|
|
31581
|
+
setOptions(prevOptions => {
|
|
31582
|
+
var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
|
|
31583
|
+
const newOptions = prevOptions.map(opt => opt.id === id ? {
|
|
31584
|
+
...opt,
|
|
31585
|
+
selected: checked
|
|
31586
|
+
} : opt);
|
|
31587
|
+
// Set loading for this checkbox
|
|
31588
|
+
setLoading(prev => ({
|
|
31589
|
+
...prev,
|
|
31590
|
+
[id]: true
|
|
31591
|
+
}));
|
|
31592
|
+
setAlert(prev => ({
|
|
31593
|
+
...prev,
|
|
31594
|
+
[id]: null
|
|
31595
|
+
}));
|
|
31596
|
+
// Save to backend
|
|
31597
|
+
const selectedIds = newOptions.filter(opt => opt.selected).map(opt => opt.id);
|
|
31598
|
+
const email = (_window$Pelcro$user$r3 = (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : window.Pelcro.helpers.getURLParameter("email");
|
|
31599
|
+
const requestData = {
|
|
31600
|
+
email,
|
|
31601
|
+
source: "web",
|
|
31602
|
+
lists: selectedIds.join(",")
|
|
31603
|
+
};
|
|
31604
|
+
|
|
31605
|
+
// Check if this is a new subscription
|
|
31606
|
+
window.Pelcro.newsletter.getByEmail(email, (err, res) => {
|
|
31607
|
+
if (err) {
|
|
31608
|
+
setLoading(prev => ({
|
|
31609
|
+
...prev,
|
|
31610
|
+
[id]: false
|
|
31611
|
+
}));
|
|
31612
|
+
setAlert(prev => ({
|
|
31613
|
+
...prev,
|
|
31614
|
+
[id]: "Error checking subscription status"
|
|
31615
|
+
}));
|
|
31616
|
+
return;
|
|
31617
|
+
}
|
|
31618
|
+
const didSubToNewslettersBefore = Boolean(res.data.email);
|
|
31619
|
+
const callback = err => {
|
|
31620
|
+
setLoading(prev => ({
|
|
31621
|
+
...prev,
|
|
31622
|
+
[id]: false
|
|
31623
|
+
}));
|
|
31624
|
+
setAlert(prev => ({
|
|
31625
|
+
...prev,
|
|
31626
|
+
[id]: err ? "Error saving" : "Saved!"
|
|
31627
|
+
}));
|
|
31628
|
+
};
|
|
31629
|
+
if (didSubToNewslettersBefore) {
|
|
31630
|
+
window.Pelcro.newsletter.update(requestData, callback);
|
|
31631
|
+
} else {
|
|
31632
|
+
window.Pelcro.newsletter.create(requestData, callback);
|
|
31633
|
+
}
|
|
31634
|
+
});
|
|
31635
|
+
return newOptions;
|
|
31636
|
+
});
|
|
31637
|
+
};
|
|
31638
|
+
if (isLoading) return /*#__PURE__*/React__default.createElement("div", {
|
|
31639
|
+
className: "plc-flex plc-justify-center plc-items-center plc-h-32"
|
|
31640
|
+
}, /*#__PURE__*/React__default.createElement(Loader, {
|
|
31641
|
+
width: 60,
|
|
31642
|
+
height: 100
|
|
31643
|
+
}));
|
|
31644
|
+
if (error) return /*#__PURE__*/React__default.createElement("div", {
|
|
31645
|
+
className: "plc-text-red-600 plc-p-4"
|
|
31646
|
+
}, error);
|
|
31647
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
31648
|
+
className: "plc-mb-4 plc-text-sm plc-text-gray-600"
|
|
31649
|
+
}, t("labels.emailPreferences.description") || "Select which email updates you would like to receive."), options.map(opt => /*#__PURE__*/React__default.createElement("div", {
|
|
31650
|
+
key: opt.id,
|
|
31651
|
+
className: "plc-flex plc-items-center plc-mb-2"
|
|
31652
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
31653
|
+
type: "checkbox",
|
|
31654
|
+
id: `email-pref-${opt.id}`,
|
|
31655
|
+
checked: !!opt.selected,
|
|
31656
|
+
onChange: handleCheckboxChange(opt.id),
|
|
31657
|
+
disabled: loading[opt.id],
|
|
31658
|
+
className: "plc-mr-2"
|
|
31659
|
+
}), /*#__PURE__*/React__default.createElement("label", {
|
|
31660
|
+
htmlFor: `email-pref-${opt.id}`,
|
|
31661
|
+
className: "plc-text-base"
|
|
31662
|
+
}, opt.label))));
|
|
31663
|
+
};
|
|
31664
|
+
|
|
31540
31665
|
const SUB_MENUS = {
|
|
31541
31666
|
PROFILE: "profile",
|
|
31542
31667
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -31547,7 +31672,8 @@ const SUB_MENUS = {
|
|
|
31547
31672
|
GIFTS: "gifts",
|
|
31548
31673
|
ORDERS: "orders",
|
|
31549
31674
|
INVOICES: "invoices",
|
|
31550
|
-
SAVED_ITEMS: "saved-items"
|
|
31675
|
+
SAVED_ITEMS: "saved-items",
|
|
31676
|
+
EMAIL_PREFERENCES: "email-preferences"
|
|
31551
31677
|
};
|
|
31552
31678
|
|
|
31553
31679
|
/**
|
|
@@ -32041,13 +32167,14 @@ class Dashboard extends Component {
|
|
|
32041
32167
|
this.enableReactGA4 = (_window = window) === null || _window === void 0 ? void 0 : (_window$Pelcro = _window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableReactGA4;
|
|
32042
32168
|
}
|
|
32043
32169
|
render() {
|
|
32044
|
-
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet;
|
|
32170
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
32045
32171
|
const {
|
|
32046
32172
|
isOpen
|
|
32047
32173
|
} = this.state;
|
|
32048
32174
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
32049
32175
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
32050
32176
|
const newsletters = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.newsletters;
|
|
32177
|
+
const emailNotifications = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.emailNotifications;
|
|
32051
32178
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
32052
32179
|
return /*#__PURE__*/React__default.createElement(Transition, {
|
|
32053
32180
|
className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full plc-max-w-xl plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
|
|
@@ -32125,7 +32252,7 @@ class Dashboard extends Component {
|
|
|
32125
32252
|
}),
|
|
32126
32253
|
className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
|
|
32127
32254
|
onClick: this.displayChangePassword
|
|
32128
|
-
}, this.locale("labels.changePassword")), siteHasNewslettersDefined && /*#__PURE__*/React__default.createElement(Button, {
|
|
32255
|
+
}, this.locale("labels.changePassword")), siteHasNewslettersDefined && emailNotifications !== true && /*#__PURE__*/React__default.createElement(Button, {
|
|
32129
32256
|
variant: "ghost",
|
|
32130
32257
|
icon: /*#__PURE__*/React__default.createElement(SvgNewsletter, {
|
|
32131
32258
|
className: "plc-w-5 plc-h-5 plc-mr-1"
|
|
@@ -32215,6 +32342,12 @@ class Dashboard extends Component {
|
|
|
32215
32342
|
icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
|
|
32216
32343
|
title: this.locale("labels.savedItems.label"),
|
|
32217
32344
|
content: /*#__PURE__*/React__default.createElement(SavedItemsMenu, null)
|
|
32345
|
+
}), /*#__PURE__*/React__default.createElement(Accordion.item, {
|
|
32346
|
+
show: emailNotifications === true,
|
|
32347
|
+
name: SUB_MENUS.EMAIL_PREFERENCES,
|
|
32348
|
+
icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
|
|
32349
|
+
title: this.locale("labels.emailPreferences.label"),
|
|
32350
|
+
content: /*#__PURE__*/React__default.createElement(EmailPreferencesMenu, null)
|
|
32218
32351
|
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
32219
32352
|
variant: "outline",
|
|
32220
32353
|
icon: /*#__PURE__*/React__default.createElement(SvgExit, null),
|
package/dist/pelcro.css
CHANGED
|
@@ -2838,6 +2838,11 @@ apple-pay-button {
|
|
|
2838
2838
|
color: rgba(180, 48, 43, var(--tw-text-opacity));
|
|
2839
2839
|
}
|
|
2840
2840
|
|
|
2841
|
+
.pelcro-root .plc-text-red-600 {
|
|
2842
|
+
--tw-text-opacity: 1;
|
|
2843
|
+
color: rgba(139, 37, 33, var(--tw-text-opacity));
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2841
2846
|
.pelcro-root .plc-text-red-700 {
|
|
2842
2847
|
--tw-text-opacity: 1;
|
|
2843
2848
|
color: rgba(98, 26, 23, var(--tw-text-opacity));
|