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 loading status on QRCode components #753

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions packages/lib/src/components/helpers/QRLoaderContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { h } from 'preact';
import UIElement, { UIElementProps } from '../UIElement';
import QRLoader from '../internal/QRLoader';
import CoreProvider from '../../core/Context/CoreProvider';
import RedirectButton from '../internal/RedirectButton';

interface QRLoaderContainerProps extends UIElementProps {
/**
Expand Down Expand Up @@ -67,10 +68,18 @@ class QRLoaderContainer extends UIElement<QRLoaderContainerProps> {
}

if (this.props.showPayButton) {
return this.payButton({
label: this.props.buttonLabel ? this.props.i18n.get(this.props.buttonLabel) : this.props.i18n.get('continue'),
classNameModifiers: ['standalone']
});
return (
<CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext}>
<RedirectButton
name={this.displayName}
onSubmit={this.submit}
payButton={this.payButton}
ref={ref => {
this.componentRef = ref;
}}
/>
</CoreProvider>
);
}

return null;
Expand Down