Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix group loan modal #754

Merged
merged 13 commits into from
Dec 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const StackableMaterial: FC<StackableMaterialProps & MaterialProps> = ({
const handleOpenDueDateModal = () => {
if (openDueDateModal && dueDate) {
openDueDateModal(dueDate);
return;
}
openLoanDetailsModal(loan);
Comment on lines 37 to +41
Copy link
Contributor

@JacobArrow JacobArrow Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels weird somehow
Why not just a regular if/else or just
(openDueDateModal && dueDate) ? openDueDateModal(dueDate) : openLoanDetailsModal(loan)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because
image

Copy link
Contributor

@JacobArrow JacobArrow Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but you can either return the whole statement or remove the curly braces

  const handleOpenDueDateModal = () =>
    openDueDateModal && dueDate
      ? openDueDateModal(dueDate)
      : openDueDateModal(dueDate);

OR

  const handleOpenDueDateModal = () => {
    return openDueDateModal && dueDate
      ? openDueDateModal(dueDate)
      : openDueDateModal(dueDate);
  };

};

return (
Expand Down
Loading