{ submitButtonHeader || null }
{ showContinueToNextIncompleteStep ? (
) : (
submitButton || (
)
) }
{ submitButtonFooter || null }
);
}
const StepWrapper = styled.div< HTMLAttributes< HTMLDivElement > >`
position: relative;
padding: 24px;
width: 100%;
box-sizing: border-box;
@media ( ${ ( props ) => props.theme.breakpoints.tabletUp } ) {
padding: 50px 0 0 0;
}
`;
const StepContentWrapper = styled.div< StepContentWrapperProps & HTMLAttributes< HTMLDivElement > >`
color: ${ ( props ) => props.theme.colors.textColor };
display: ${ ( props ) => ( props.isVisible ? 'block' : 'none' ) };
box-sizing: border-box;
@media ( ${ ( props ) => props.theme.breakpoints.tabletUp } ) {
padding-left: 40px;
}
.rtl & {
@media ( ${ ( props ) => props.theme.breakpoints.tabletUp } ) {
padding-left: 0;
padding-right: 40px;
}
}
`;
interface StepContentWrapperProps {
isVisible?: boolean;
}
const StepSummaryWrapper = styled.div< StepContentWrapperProps & HTMLAttributes< HTMLDivElement > >`
color: ${ ( props ) => props.theme.colors.textColorLight };
font-size: 14px;
display: ${ ( props ) => ( props.isVisible ? 'block' : 'none' ) };
box-sizing: border-box;
@media ( ${ ( props ) => props.theme.breakpoints.tabletUp } ) {
padding-left: 40px;
}
.rtl & {
@media ( ${ ( props ) => props.theme.breakpoints.tabletUp } ) {
padding-left: 0;
padding-right: 40px;
}
}
`;
export function CheckoutStepBody( {
errorMessage,
editButtonText,
editButtonElement,
editButtonAriaLabel,
nextStepButtonText,
validatingButtonText,
nextStepButtonAriaLabel,
validatingButtonAriaLabel,
isStepActive,
isStepComplete,
canEditStep,
className,
stepNumber,
stepId,
titleContent,
goToThisStep,
goToNextStep,
activeStepContent,
formStatus,
completeStepContent,
onError,
}: CheckoutStepBodyProps ) {
const { __ } = useI18n();
// Since both the active and inactive step content can be mounted at the same
// time (by design so that both may hold state in form elements), these
// test-ids can be used for tests to differentiate which version of a step is
// currently visible.
const activeStepTestId = isStepActive ? `${ stepId }--visible` : `${ stepId }--invisible`;
const completeStepTestId = isStepActive ? `${ stepId }--invisible` : `${ stepId }--visible`;
return (