fix: buttonLabel conditions (#5336)

Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
This commit is contained in:
Dhruwang Jariwala
2025-04-13 14:06:59 +05:30
committed by GitHub
parent c533f37983
commit eb08a0ed14
2 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ export function BackButton({ onClick, backButtonLabel, tabIndex = 2 }: BackButto
"fb-border-back-button-border fb-text-heading focus:fb-ring-focus fb-rounded-custom fb-flex fb-items-center fb-border fb-px-3 fb-py-3 fb-text-base fb-font-medium fb-leading-4 fb-shadow-sm hover:fb-opacity-90 focus:fb-outline-none focus:fb-ring-2 focus:fb-ring-offset-2"
)}
onClick={onClick}>
{backButtonLabel ?? "Back"}
{backButtonLabel || "Back"}
</button>
);
}

View File

@@ -2,7 +2,7 @@ import { ButtonHTMLAttributes, useRef } from "preact/compat";
import { useCallback, useEffect } from "preact/hooks";
interface SubmitButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
buttonLabel: string | undefined;
buttonLabel?: string;
isLastQuestion: boolean;
focus?: boolean;
}
@@ -56,7 +56,7 @@ export function SubmitButton({
className="fb-bg-brand fb-border-submit-button-border fb-text-on-brand focus:fb-ring-focus fb-rounded-custom fb-flex fb-items-center fb-border fb-px-3 fb-py-3 fb-text-base fb-font-medium fb-leading-4 fb-shadow-sm hover:fb-opacity-90 focus:fb-outline-none focus:fb-ring-2 focus:fb-ring-offset-2"
onClick={onClick}
disabled={disabled}>
{buttonLabel ?? (isLastQuestion ? "Finish" : "Next")}
{buttonLabel || (isLastQuestion ? "Finish" : "Next")}
</button>
);
}