Skip to content

Commit 013a576

Browse files
Final Touches(last one I swear)
1 parent 59c7231 commit 013a576

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

frontend/src/components/Apartment/LandlordMessagingModal.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,21 @@ const LandlordMessagingModal = ({
506506
}
507507
};
508508

509+
const closeAllModals = () => {
510+
setShowConfirmModal(false);
511+
onClose();
512+
};
513+
514+
const handleConfirmSuccess = () => {
515+
if (onEmailSuccess) onEmailSuccess();
516+
closeAllModals();
517+
};
518+
519+
const handleConfirmFailure = () => {
520+
if (onEmailFailure) onEmailFailure();
521+
closeAllModals();
522+
};
523+
509524
return (
510525
<Dialog
511526
open={open}
@@ -990,13 +1005,13 @@ const LandlordMessagingModal = ({
9901005
</DialogContent>
9911006
<ConfirmLandlordMessagingModal
9921007
open={showConfirmModal}
993-
1008+
email={email}
9941009
subject={subject}
9951010
body={message}
9961011
onClose={() => setShowConfirmModal(false)}
9971012
isMobile={isMobile}
998-
triggerToast={onEmailSuccess}
999-
triggerErrorToast={onEmailFailure}
1013+
triggerToast={handleConfirmSuccess}
1014+
triggerErrorToast={handleConfirmFailure}
10001015
/>
10011016
</Dialog>
10021017
);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11485,10 +11485,10 @@
1148511485
"regenerator-runtime" "^0.13.7"
1148611486
"whatwg-fetch" "^3.4.1"
1148711487

11488-
"react-datepicker@^8.3.0":
11489-
"integrity" "sha512-DhfrIJnTPJTUVRtXU7c7zooug40rD6q+Fc8UTCt19dYEotLpDQgTN98MfocY6Rc4S99oOFFEoxyanOM/TKauuw=="
11490-
"resolved" "https://registry.npmjs.org/react-datepicker/-/react-datepicker-8.3.0.tgz"
11491-
"version" "8.3.0"
11488+
"react-datepicker@^8.7.0":
11489+
"integrity" "sha512-r5OJbiLWc3YiVNy69Kau07/aVgVGsFVMA6+nlqCV7vyQ8q0FUOnJ+wAI4CgVxHejG3i5djAEiebrF8/Eip4rIw=="
11490+
"resolved" "https://registry.npmjs.org/react-datepicker/-/react-datepicker-8.7.0.tgz"
11491+
"version" "8.7.0"
1149211492
dependencies:
1149311493
"@floating-ui/react" "^0.27.15"
1149411494
"clsx" "^2.1.1"

0 commit comments

Comments
 (0)