makerspace-react-rails 0.4.1 → 0.4.2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f56b54a1292e87640140ba2b3fd8c845fc78831760a115f259c50d353c955744
|
4
|
+
data.tar.gz: 3e79cdce97f0b4d2253620462a51ecbde08f44fa566347a815414cfb8da777e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 376072eb99ebc9a432a733a8fb44a4b07f245147ae9e8c68bf668323620c6204e89cd0f569d81cf66d0810ef0dbb065830b0030151ee165deb5599d224295fb4
|
7
|
+
data.tar.gz: 13bced1a12dd04a7e83ae3948f901a4c998a39af12c630b536970304f9904646128f3ffaea42acdda7dcd9b0b62a39d74b317312f9456ff231c5ea5f786908a2
|
@@ -184713,23 +184713,27 @@ var MemberProfile = function () {
|
|
184713
184713
|
history.push(constants_1.Routing.Settings.replace(constants_1.Routing.PathPlaceholder.MemberId, currentUserId));
|
184714
184714
|
}, [currentUserId]);
|
184715
184715
|
var _e = useReadTransaction_1.default(makerspace_ts_api_client_1.getMember, memberId), memberLoading = _e.isRequesting, refreshMember = _e.refresh, memberError = _e.error, _f = _e.data, member = _f === void 0 ? {} : _f;
|
184716
|
-
var _g = React.useState(), notification = _g[0],
|
184717
|
-
React.
|
184716
|
+
var _g = React.useState(), notification = _g[0], setNotification = _g[1];
|
184717
|
+
React.useLayoutEffect(function () {
|
184718
184718
|
if (isOwnProfile && !memberLoading && member.hasOwnProperty("memberContractOnFile")) {
|
184719
184719
|
if (member.memberContractOnFile) {
|
184720
|
-
|
184720
|
+
setNotification(undefined);
|
184721
184721
|
}
|
184722
184722
|
else {
|
184723
|
-
|
184723
|
+
setNotification(NotificationModal_1.Notification.Welcome);
|
184724
184724
|
}
|
184725
184725
|
}
|
184726
|
-
}, [isOwnProfile, memberLoading,
|
184726
|
+
}, [isOwnProfile, memberLoading, setNotification, member.memberContractOnFile]);
|
184727
|
+
// Don't render the notification box on the first paint
|
184728
|
+
// Helps prevent flickering issue
|
184729
|
+
var _h = React.useState(false), renderNotification = _h[0], setRenderNotification = _h[1];
|
184730
|
+
React.useEffect(function () { return setRenderNotification(true); }, []);
|
184727
184731
|
var customerId = member.customerId, earnedMembershipId = member.earnedMembershipId;
|
184728
184732
|
var isEarnedMember = !!earnedMembershipId && (isOwnProfile || isAdmin);
|
184729
184733
|
var closeNotification = React.useCallback(function () {
|
184730
184734
|
refreshMember();
|
184731
|
-
|
184732
|
-
}, [refreshMember,
|
184735
|
+
setNotification(undefined);
|
184736
|
+
}, [refreshMember, setNotification]);
|
184733
184737
|
var goToAgreements = React.useCallback(function () {
|
184734
184738
|
history.push(constants_1.Routing.Documents);
|
184735
184739
|
}, [history]);
|
@@ -184773,7 +184777,7 @@ var MemberProfile = function () {
|
|
184773
184777
|
displayName: "Payment History",
|
184774
184778
|
content: (React.createElement(TransactionsList_1.default, { member: member }))
|
184775
184779
|
}] : []) }),
|
184776
|
-
React.createElement(NotificationModal_1.default, { notification: notification, onSubmit: goToAgreements, onClose: closeNotification })));
|
184780
|
+
renderNotification && React.createElement(NotificationModal_1.default, { notification: notification, onSubmit: goToAgreements, onClose: closeNotification })));
|
184777
184781
|
};
|
184778
184782
|
exports.default = MemberProfile;
|
184779
184783
|
|
@@ -185066,7 +185070,7 @@ var NotificationModal = /** @class */ (function (_super) {
|
|
185066
185070
|
return null;
|
185067
185071
|
}
|
185068
185072
|
var closeHandler = displayedNotification.required ? undefined : onClose;
|
185069
|
-
return (React.createElement(FormModal_1.default, { formRef: this.setFormRef, id: "notification-modal", isOpen:
|
185073
|
+
return (React.createElement(FormModal_1.default, { formRef: this.setFormRef, id: "notification-modal", isOpen: true, title: displayedNotification.title, onSubmit: onSubmit, submitText: displayedNotification.submit, closeHandler: closeHandler },
|
185070
185074
|
React.createElement(Typography_1.default, { variant: "body1", style: { whiteSpace: "pre-line" } }, displayedNotification.body)));
|
185071
185075
|
};
|
185072
185076
|
return NotificationModal;
|