Skip to content
Merged
Changes from all commits
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 @@ -34,7 +34,9 @@ export const CampaignSetupActions: React.FC<CampaignSetupActionsProps> = ({
? !isFormValid || isSubmitting
: activeStep === 1
? !isAssignmentComplete
: false;
: activeStep === 4
? isSubmitting
: false;
Comment on lines 34 to +39

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Instead of adding another level of nested ternary operators to handle activeStep === 4, we can simplify the logic and make it more robust. By applying isSubmitting as a fallback or general condition, we ensure that the primary action button is disabled during submission across all steps, while also keeping the code cleaner and easier to read.

      ? !isFormValid || isSubmitting
      : (activeStep === 1
        ? !isAssignmentComplete
        : false) || isSubmitting;


const handleNextClick = () => {
if (activeStep === 0) {
Expand Down
Loading